pub struct CoalescingEmitter { /* private fields */ }Expand description
A throttled event emitter that coalesces rapid-fire events.
Wraps any QueueEventEmitter and suppresses duplicate events for the
same job that arrive within the configured coalesce interval.
Implementations§
Source§impl CoalescingEmitter
impl CoalescingEmitter
pub fn new(inner: Arc<dyn QueueEventEmitter>, config: EmitterConfig) -> Self
pub fn arc( inner: Arc<dyn QueueEventEmitter>, config: EmitterConfig, ) -> Arc<dyn QueueEventEmitter>
Trait Implementations§
Source§impl QueueEventEmitter for CoalescingEmitter
impl QueueEventEmitter for CoalescingEmitter
Source§fn emit_job_started(&self, event: JobStartedEvent)
fn emit_job_started(&self, event: JobStartedEvent)
Called when a job starts executing.
Source§fn emit_job_completed(&self, event: JobCompletedEvent)
fn emit_job_completed(&self, event: JobCompletedEvent)
Called when a job completes successfully.
Source§fn emit_job_failed(&self, event: JobFailedEvent)
fn emit_job_failed(&self, event: JobFailedEvent)
Called when a job fails.
Source§fn emit_job_progress(&self, event: JobProgressEvent)
fn emit_job_progress(&self, event: JobProgressEvent)
Called when a job reports progress.
Source§fn emit_job_cancelled(&self, event: JobCancelledEvent)
fn emit_job_cancelled(&self, event: JobCancelledEvent)
Called when a job is cancelled.
Auto Trait Implementations§
impl !Freeze for CoalescingEmitter
impl !RefUnwindSafe for CoalescingEmitter
impl !UnwindSafe for CoalescingEmitter
impl Send for CoalescingEmitter
impl Sync for CoalescingEmitter
impl Unpin for CoalescingEmitter
impl UnsafeUnpin for CoalescingEmitter
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