Skip to content

Conversation

tisonkun
Copy link
Contributor

@tisonkun tisonkun commented Oct 3, 2025

This closes #145.

Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Comment on lines 30 to 35
#[derive(Debug)]
pub struct Asynchronous {
appends: Arc<[Box<dyn Append>]>,
overflow: Overflow,
state: AppendState,
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for @ SpriteOvO's spdlog-rs AsyncPoolSink. I borrow most of the design while change the thread pool to a single background thread.

One open issue is about naming. Since async is a keyword now, we'd better use a different name from Async here. Currently I use Asynchronous, but I'd prefer a shorter name. Considering AsyncPool, perhaps AsyncSingleThread or other.

BTW we need to implement a clean up logic atexit, related to SpriteOvO/spdlog-rs#102

Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Comment on lines +77 to +81
fn exit(&self) -> Result<(), Error> {
// fastrace flush accesses thread-local storage,
// which is not supported in atexit handlers
Ok(())
}
Copy link
Contributor Author

@tisonkun tisonkun Oct 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andylokandy Then we rely on the caller/application to call fastrace::flush on exit, like what we do in ScopeDB.

@tisonkun tisonkun merged commit 2f21ab5 into main Oct 6, 2025
9 checks passed
@tisonkun tisonkun deleted the nv branch October 6, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async appender

1 participant