Skip to content

Feed Sinks

quantpylib.hft.archival defines the sink interface that may be consumed by quantpylib.hft.feed.Feed and the base queue/null sink implementations. These sinks receive (feed_id, event) from the feed fanout path; durable L0/QBN capture is implemented in quantpylib.hft.l0.

FeedSink

Base interface for objects that consume Feed events.

Feed calls write(feed_id, event) for each event routed to the sink. feed_id is a quantpylib.standards.models.FeedId; event is the object emitted by the feed, such as BookUpdate, BBAUpdate, or TradeUpdate for native market-data feeds.

Sink methods may be synchronous or asynchronous. Feed awaits awaitable results from write() and close(), but it ignores the return value.

close()

Close the sink. Implementations should make this idempotent.

flush()

Flush buffered sink state if the implementation buffers work.

write(feed_id, event)

Consume one feed event.