mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-22 15:42:25 +02:00
Collapse the eager async pump task into the same caller-driven model as sync: each cursor's advance drives one graph event through the mux. Concurrent async consumers serialize through an asyncio.Lock so each acquisition produces exactly one event, matching sync semantics. EventLog becomes a single-consumer drainable queue — items pop off as the cursor advances, a second __iter__ / __aiter__ raises. Fan-out moves to explicit tee(n) / atee(n) helpers. Retention windows, BufferOverflowError, and max_events are gone; pre- subscription pushes are silent no-ops so unsubscribed projections don't accumulate. Both run streams gain abort() and context-manager support; the pump's BaseException catch is narrowed to Exception so CancelledError propagates per asyncio contract. TestMemoryBounds locks in the drain-on-consume invariants: subscribed buffers drop back to empty after each yield, unsubscribed projections never accumulate, and run.output leaves the values log untouched.