emit-rs / emit

Developer-first diagnostics for Rust applications
https://emit-rs.io
Apache License 2.0
128 stars 2 forks source link

Always check for tokio runtime thread in emit_batcher blocking fns #97

Closed KodrAus closed 2 months ago

KodrAus commented 2 months ago

In emit_batcher, if the tokio feature is enabled then we should always check if we're on one of its threads before running blocking work. The only blocking should be in blocking_flush, which is intended to run at the end of the main function, but to make sure we're good async citizens, we should be trying to avoid blocking up the runtime, or at least informing it before we do.