Struct opentracingrust::utils::ReporterThread [] [src]

pub struct ReporterThread { /* fields omitted */ }

A basic span reporter backed by a background thread.

The reporter spawns a thread that loops until stopped and waits for FinishedSpans. Every time a finished span is received the ReporterFn closure is called with it. The ReporterFn closure is responsible for shipping the received spans.

The ReporterThread also supports clean shutdown of the receiver thread. When ReporterThread::stop is called or an instance is dropped:

  1. The calling thread is paused for the stop_delay duration. This allows the reporter thread to process any FinishedSpans still in the channel.
  2. The background thread is informend to shutdown and the calling thread joins it.
  3. As soon as any FinishedSpan is processed or receiving times out the thread is stopped. Receiving spans times out every 50 milliseconds.

Methods

impl ReporterThread
[src]

[src]

Creates a new reporter waiting for spans on the receiver.

The reporter starts with a spawned thread and runs until stopped or dropped.

[src]

Version of new that also sets the stop_delay.

[src]

Updates the stop_delay for when the thread is stopped.

[src]

Stops the background thread and joins it.

Trait Implementations

impl Drop for ReporterThread
[src]

[src]

Executes the destructor for this type. Read more