pub struct Job<TKey, TMsg>{
pub key: TKey,
pub msg: TMsg,
pub options: JobOptions,
pub accepted: Option<RpcReplyPort<Option<Self>>>,
}Expand description
Represents a job sent to a factory
Depending on the super::Factory’s routing scheme the
Job’s key is utilized to dispatch the job to specific
workers.
Fields§
§key: TKeyThe key of the job
msg: TMsgThe message of the job
options: JobOptionsThe job’s options, mainly related to timing information of the job
Default = JobOptions::default()
accepted: Option<RpcReplyPort<Option<Self>>>If provided, this channel can be used to block pushes into the factory until the factory can “accept” the message into its internal processing. This can be used to synchronize external threadpools to the Tokio processing pool and prevent overloading the unbounded channel which fronts all actors.
The reply channel return None if the job was accepted, or
[Some(Job)] if it was rejected & loadshed, and then the
job may be retried by the caller at a later time (if desired).
Default = None