pub fn async_layer<F, Fut>(buffer_size: usize, callback: F) -> CallbackLayer
Expand description
Returns a layer that will call an async callback on each relevant event. 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.