pub struct JobBuilder<TKey, TMsg, S: State = Empty>{ /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<TKey, TMsg, S: State> JobBuilder<TKey, TMsg, S>
impl<TKey, TMsg, S: State> JobBuilder<TKey, TMsg, S>
Sourcepub fn build(self) -> Job<TKey, TMsg>where
S: IsComplete,
pub fn build(self) -> Job<TKey, TMsg>where
S: IsComplete,
Finish building and return the requested object
Sourcepub fn key(self, value: TKey) -> JobBuilder<TKey, TMsg, SetKey<S>>where
S::Key: IsUnset,
pub fn key(self, value: TKey) -> JobBuilder<TKey, TMsg, SetKey<S>>where
S::Key: IsUnset,
Required.
The key of the job
Sourcepub fn msg(self, value: TMsg) -> JobBuilder<TKey, TMsg, SetMsg<S>>where
S::Msg: IsUnset,
pub fn msg(self, value: TMsg) -> JobBuilder<TKey, TMsg, SetMsg<S>>where
S::Msg: IsUnset,
Required.
The message of the job
Sourcepub fn options(self, value: JobOptions) -> JobBuilder<TKey, TMsg, SetOptions<S>>where
S::Options: IsUnset,
pub fn options(self, value: JobOptions) -> JobBuilder<TKey, TMsg, SetOptions<S>>where
S::Options: IsUnset,
Optional (Some / Option setters).
Default: JobOptions::default().
The job’s options, mainly related to timing information of the job
Default = JobOptions::default()
Sourcepub fn maybe_options(
self,
value: Option<JobOptions>,
) -> JobBuilder<TKey, TMsg, SetOptions<S>>where
S::Options: IsUnset,
pub fn maybe_options(
self,
value: Option<JobOptions>,
) -> JobBuilder<TKey, TMsg, SetOptions<S>>where
S::Options: IsUnset,
Optional (Some / Option setters).
Default: JobOptions::default().
The job’s options, mainly related to timing information of the job
Default = JobOptions::default()
Sourcepub fn accepted(
self,
value: RpcReplyPort<Option<Job<TKey, TMsg>>>,
) -> JobBuilder<TKey, TMsg, SetAccepted<S>>where
S::Accepted: IsUnset,
pub fn accepted(
self,
value: RpcReplyPort<Option<Job<TKey, TMsg>>>,
) -> JobBuilder<TKey, TMsg, SetAccepted<S>>where
S::Accepted: IsUnset,
Optional (Some / Option setters). 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
Sourcepub fn maybe_accepted(
self,
value: Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>,
) -> JobBuilder<TKey, TMsg, SetAccepted<S>>where
S::Accepted: IsUnset,
pub fn maybe_accepted(
self,
value: Option<RpcReplyPort<Option<Job<TKey, TMsg>>>>,
) -> JobBuilder<TKey, TMsg, SetAccepted<S>>where
S::Accepted: IsUnset,
Optional (Some / Option setters). 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