pub struct AutoConsumer { /* private fields */ }Expand description
Automatic consumer that runs in a background thread.
This provides a handle to a consumer running automatic event processing in a separate thread. It supports graceful shutdown and cleanup operations.
Implementations§
Source§impl AutoConsumer
impl AutoConsumer
Sourcepub fn shutdown_and_join(&mut self)
pub fn shutdown_and_join(&mut self)
Shutdown and wait for the consumer thread to finish
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the consumer thread is still running
Trait Implementations§
Source§impl Drop for AutoConsumer
Automatic resource management for AutoConsumer.
impl Drop for AutoConsumer
Automatic resource management for AutoConsumer.
Ensures proper cleanup when the consumer goes out of scope, which matters for embedded host runtimes (e.g. an FFI consumer wrapped by a garbage-collected language) that expect automatic resource management.
Auto Trait Implementations§
impl Freeze for AutoConsumer
impl !RefUnwindSafe for AutoConsumer
impl Send for AutoConsumer
impl Sync for AutoConsumer
impl Unpin for AutoConsumer
impl UnsafeUnpin for AutoConsumer
impl !UnwindSafe for AutoConsumer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more