Function flush_subscribers

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub fn flush_subscribers() -> Result<()>

Wait for all subscriber callbacks and managed terminal publications registered before this call to finish, including publications emitted transitively by those callbacks.

A direct re-entrant call from queued publication middleware returns without waiting. Publication middleware must not move such a flush into tokio::spawn, tokio::task::spawn_blocking, or another unmarked task or thread because the publication cannot complete while awaiting that flush.

Native targets deliver subscriber callbacks on a background dispatcher so event-producing APIs do not wait for observer work. Call this helper from tests, shutdown paths, or exporter lifecycle code when callers need a deterministic observation barrier.