Skip to main content

QueueEventEmitter

Trait QueueEventEmitter 

Source
pub trait QueueEventEmitter:
    Send
    + Sync
    + 'static {
    // Required methods
    fn emit_job_started(&self, event: JobStartedEvent);
    fn emit_job_completed(&self, event: JobCompletedEvent);
    fn emit_job_failed(&self, event: JobFailedEvent);
    fn emit_job_progress(&self, event: JobProgressEvent);
    fn emit_job_cancelled(&self, event: JobCancelledEvent);
}
Expand description

Trait for emitting queue lifecycle events.

Implement this trait to receive notifications about job state changes. For example, a Tauri app would implement this to emit events to the frontend, while a CLI app might log to stdout or update a progress bar.

Required Methods§

Source

fn emit_job_started(&self, event: JobStartedEvent)

Called when a job starts executing.

Source

fn emit_job_completed(&self, event: JobCompletedEvent)

Called when a job completes successfully.

Source

fn emit_job_failed(&self, event: JobFailedEvent)

Called when a job fails.

Source

fn emit_job_progress(&self, event: JobProgressEvent)

Called when a job reports progress.

Source

fn emit_job_cancelled(&self, event: JobCancelledEvent)

Called when a job is cancelled.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§