pub fn async_layer_with_spans<F, Fut>(
buffer_size: usize,
callback: F,
) -> CallbackLayerWithSpan
Expand description
Returns a layer that will call an async callback on each relevant event along with parent spans. This type of layer can be used, for example, to save tracing events into a database.
Note that this is NOT an async closure but a normal function that returns a future. In practice that will often be a function whose return value is an async block that is not awaited.