pub trait Processor:
Send
+ Sync
+ 'static {
type Value: Send + Sync + 'static;
const NAME: &'static str;
const FANOUT: usize = 10usize;
// Required method
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
checkpoint: &'life1 Arc<CheckpointData>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Implementors of this trait are responsible for transforming checkpoint into rows for their
table. The FANOUT
associated value controls how many concurrent workers will be used to
process checkpoint information.
Required Associated Constants§
Provided Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn process<'life0, 'life1, 'async_trait>(
&'life0 self,
checkpoint: &'life1 Arc<CheckpointData>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process<'life0, 'life1, 'async_trait>(
&'life0 self,
checkpoint: &'life1 Arc<CheckpointData>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The processing logic for turning a checkpoint into rows of the table.
All errors returned from this method are treated as transient and will be retried indefinitely with exponential backoff.
If you encounter a permanent error that will never succeed on retry (e.g., invalid data format, unsupported protocol version), you should panic! This stops the indexer and alerts operators that manual intervention is required. Do not return permanent errors as they will cause infinite retries and block the pipeline.
For transient errors (e.g., network issues, rate limiting), simply return the error and let the framework retry automatically.
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.