Description
Both WatchedField._change_queue (sdk/src/opendecree/watcher.py:59) and AsyncWatchedField._change_queue (sdk/src/opendecree/async_watcher.py:59) use unbounded queue.Queue() / asyncio.Queue() with no maxsize. If a consumer of field.changes() falls behind while the server sends rapid updates, memory grows indefinitely.
The TypeScript SDK already handles this with DEFAULT_QUEUE_SIZE = 1024 and a drop-oldest strategy with _droppedChanges tracking (decree-typescript/src/watcher.ts:31,203-206). The Python SDK should adopt the same pattern.
Acceptance criteria
Description
Both
WatchedField._change_queue(sdk/src/opendecree/watcher.py:59) andAsyncWatchedField._change_queue(sdk/src/opendecree/async_watcher.py:59) use unboundedqueue.Queue()/asyncio.Queue()with nomaxsize. If a consumer offield.changes()falls behind while the server sends rapid updates, memory grows indefinitely.The TypeScript SDK already handles this with
DEFAULT_QUEUE_SIZE = 1024and a drop-oldest strategy with_droppedChangestracking (decree-typescript/src/watcher.ts:31,203-206). The Python SDK should adopt the same pattern.Acceptance criteria
WatchedFieldandAsyncWatchedFieldaccept amax_queue_sizeparameter (default 1024)dropped_changescounter is exposed on the field object