2.1 KiB
The user asked to continue the paired piker broadcast-consumer work after Tractor PR 490 stabilization. The next item was to stop cached feed callers from mutating or consuming shared Feed/Flume quote-stream roots, then review, verify and prepare a commit boundary.
git diff HEAD~1..HEAD -- piker/data/feed.py
Changed maybe_open_feed() so the cached Feed exclusively owns provider root streams and every caller, including the first cache owner, receives a caller-local Feed/Flume view backed by one child subscription per provider. The cache identity now includes normalized full symbol shape and stream policy.
Changed Feed.open_multi_stream() so every provider relay subscribes instead of directly consuming a shared stream, and synchronizes relay startup before yielding the merged channel. Each relay owns a cloned send channel so one provider EOC cannot terminate its siblings. The module-level relay returns its live child receiver through TaskStatus for typed retention and introspection. Documented Feed.pause()/Feed.resume() as provider-context-wide controls shared by local cache users.
git diff HEAD~1..HEAD -- tests/test_feed_broadcast.py
Added real Feed, Flume, and Tractor broadcast regressions covering both cache-miss owner and cache-hit paths, one-provider-many-market mapping, multi-provider relay fan-out and startup, duplex controls, lexical child closure, sibling survival after provider EOC, cached-root immutability, and full cache-key differentiation.
Verification output:
... [100%]
3 passed in 0.02s
. [100%]
1 passed in 0.01s
The second result is the existing EMS broadcast ownership regression. Ruff, E501, compilation and whitespace checks passed. Repeated adversarial review found and resolved shared Feed.streams, incomplete cache-key, fake-lifecycle, relay-startup and first-owner asymmetry issues; final review reported no findings.