Skip to main content

LogSink

Trait LogSink 

Source
pub trait LogSink:
    Send
    + Sync
    + 'static {
    // Required methods
    fn append(
        &self,
        chunk: LogChunk,
    ) -> impl Future<Output = Result<(), LogError>> + Send;
    fn get_all(
        &self,
        workflow_id: &str,
        job_id: &str,
    ) -> impl Future<Output = Result<Vec<LogChunk>, LogError>> + Send;
    fn subscribe(&self, workflow_id: &str, job_id: &str) -> Receiver<LogChunk>;
}
Expand description

Pluggable log storage and streaming backend.

Workers push log chunks; the server streams them to clients via SSE. Implementations: InMemoryLogSink, FileLogSink, S3LogSink.

Required Methods§

Source

fn append( &self, chunk: LogChunk, ) -> impl Future<Output = Result<(), LogError>> + Send

Append a log chunk from a worker.

Source

fn get_all( &self, workflow_id: &str, job_id: &str, ) -> impl Future<Output = Result<Vec<LogChunk>, LogError>> + Send

Get all log chunks for a job (for catch-up on SSE connect).

Source

fn subscribe(&self, workflow_id: &str, job_id: &str) -> Receiver<LogChunk>

Subscribe to live log chunks for a specific job.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§