Skip to main content

spawn

Function spawn 

Source
pub fn spawn(
    config: TelemetryConfig,
    recorders: Vec<Arc<dyn TelemetryRecorder>>,
) -> Result<(TelemetryHandle, TelemetryConsumer), SpawnError>
Expand description

Create a telemetry pipeline. Returns (handle, consumer):

  • handle records events (cloneable, non-blocking); events whose kind is disabled via config.event_toggles/default_event_enabled never enter the channel.
  • consumer drives the pipeline in the background (tokio::spawn or await): it redacts each event once, then forwards it to every recorder in recorders, in order.

recorders is how the caller decides what happens to telemetry data — this crate never constructs a network client on its own.