pub trait QueueWorker {
type Message;
// Required methods
fn receive_task(
&self,
) -> impl Future<Output = Result<Option<WrappedTask<Self::Message>>>>;
fn send_response(
&self,
message: Self::Message,
response: Response,
) -> impl Future<Output = Result<()>>;
}Expand description
Receives queued tasks and routes their responses back to producers.
Returned futures do not carry a Send guarantee; this trait is not
dyn-compatible.
Required Associated Types§
Required Methods§
Sourcefn receive_task(
&self,
) -> impl Future<Output = Result<Option<WrappedTask<Self::Message>>>>
fn receive_task( &self, ) -> impl Future<Output = Result<Option<WrappedTask<Self::Message>>>>
Receives a task, or None when none is available or the stream ends.
NATS and std memory wait for work; no_std memory polls once.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".