Skip to main content

spawn_source

Function spawn_source 

Source
pub fn spawn_source<S: EventSource>(
    source: S,
    event_tx: Sender<RawEvent>,
    metrics: Option<Arc<dyn MetricsHook>>,
) -> JoinHandle<()>
Expand description

Spawn an EventSource as a tokio task wired to a shared event channel.

The source reads events in a loop via recv() and forwards RawEvents to event_tx. When the source is exhausted or the channel is closed, the task completes. Tracks input queue depth and back-pressure metrics via the provided MetricsHook.