pub trait Backend<Req> {
type Stream: Stream<Item = Result<Option<Req>, Error>>;
type Layer;
// Required methods
fn common_layer(&self, worker: WorkerId) -> Self::Layer;
fn poll(self, worker: WorkerId) -> Poller<Self::Stream>;
}
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§
sourcefn common_layer(&self, worker: WorkerId) -> Self::Layer
fn common_layer(&self, worker: WorkerId) -> Self::Layer
Allows the backend to decorate the service with Layer