Skip to main content

pix_event_stream

Function pix_event_stream 

Source
pub(crate) fn pix_event_stream(
    session_pix_events: impl Stream<Item = HoprSessionOutPixEvent> + Send + 'static,
    ssa_share_resolutions: impl Stream<Item = HoprShareResolution> + Send + 'static,
    smgr: Arc<SessionManager<CrossfireSink<(DestinationRouting, ApplicationDataOut)>>>,
) -> impl Stream<Item = PixEvent> + Send + 'static
Expand description

Builds the merged PIX event stream feeding the upper layer.

Combines the Session-originated deposit instructions with the share resolutions coming out of the packet pipeline. Share resolutions are dispatched into the SessionManager concurrently (see PIX_EVENT_DISPATCH_CONCURRENCY).

Concurrency does not require ordering guarantees here: events for one session converge on that session’s supervisor, which is a single-threaded state machine whose handlers are idempotent per phase and whose counters are absolute rather than incremental. Of the events belonging to one cycle exactly one advances it and the rest are recognised as stale, whatever order they arrive in.