Address Bob's notes 2 and 3 with documenting comments
Note 2: poll_fallback_seconds==0 silently means 'use default'. Document in example yaml; no v1 way to disable polling, and we don't think anyone needs that. Note 3: Writer.locks grows unbounded. Bounded in practice (<10 agents); add a comment for the future maintainer who may need to evict. Notes 1 and 4 left unchanged: missingkey=zero is the friendlier choice (produces a visible '<no value>' in the inbox rather than a silent 500); fsnotify double-fire is already handled by os.ErrNotExist on second-read. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4ff8c3f78d
commit
3a586f38a9
2 changed files with 10 additions and 1 deletions
|
|
@ -48,4 +48,8 @@ sources:
|
||||||
# Valid → emit + delete. Invalid → moved to .dead-letter/ with reason.
|
# Valid → emit + delete. Invalid → moved to .dead-letter/ with reason.
|
||||||
drop_folder:
|
drop_folder:
|
||||||
path: ~/Nyx/workspace/incoming/
|
path: ~/Nyx/workspace/incoming/
|
||||||
poll_fallback_seconds: 30 # safety net if inotify misses
|
# Safety net if inotify misses an event. 0 (or unset) = use the
|
||||||
|
# 30-second default. There is no "disable polling" option in v1 —
|
||||||
|
# if you don't want polling, leave inotify to do its job and ignore
|
||||||
|
# the cost (a periodic readdir is microseconds).
|
||||||
|
poll_fallback_seconds: 30
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,11 @@ type Event struct {
|
||||||
//
|
//
|
||||||
// Concurrency: a single Writer is safe for use from multiple goroutines.
|
// Concurrency: a single Writer is safe for use from multiple goroutines.
|
||||||
// One sync.Mutex per recipient bounds contention to per-file granularity.
|
// One sync.Mutex per recipient bounds contention to per-file granularity.
|
||||||
|
//
|
||||||
|
// The locks map grows monotonically as new recipients appear. In practice
|
||||||
|
// the agent network has <10 recipients, so the leak is bounded; if this
|
||||||
|
// daemon ever lives in a system with thousands of recipients, replace the
|
||||||
|
// map with an LRU or shard-and-evict scheme.
|
||||||
type Writer struct {
|
type Writer struct {
|
||||||
dir string
|
dir string
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue