pub trait Backend<Req, Res> {
type Stream: Stream<Item = Result<Option<Req>, Error>>;
type Layer;
// Required method
fn poll<Svc: Service<Req, Response = Res>>(
self,
worker: &Worker<Context>,
) -> Poller<Self::Stream, Self::Layer>;
}Expand description
A backend represents a task source
Both Storage and MessageQueue need to implement it for workers to be able to consume tasks
Required Associated Types§
Required Methods§
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.