pub struct JobBuilder { /* private fields */ }
Expand description
A builder for a job to submit to the queue.
Implementations§
Source§impl JobBuilder
impl JobBuilder
Sourcepub fn name(self, name: impl ToString) -> Self
pub fn name(self, name: impl ToString) -> Self
Set the name of this job. This name is purely informational, and does not have to be unique. Jobs can be fetched by their name using Queue::get_jobs_by_name.
Sourcepub fn name_opt(self, name: Option<String>) -> Self
pub fn name_opt(self, name: Option<String>) -> Self
Set the name of this job. This name is purely informational, and does not have to be unique. Jobs can be fetched by their name using Queue::get_jobs_by_name.
Sourcepub fn run_at(self, run_at: OffsetDateTime) -> Self
pub fn run_at(self, run_at: OffsetDateTime) -> Self
Set the time at which the job should run.
Sourcepub fn json_payload<T: ?Sized + Serialize>(self, payload: &T) -> Result<Self>
pub fn json_payload<T: ?Sized + Serialize>(self, payload: &T) -> Result<Self>
Serialize the payload of the job using serde_json
.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Set the maximum number of retries for the job.
Sourcepub fn backoff_initial_interval(
self,
backoff_initial_interval: Duration,
) -> Self
pub fn backoff_initial_interval( self, backoff_initial_interval: Duration, ) -> Self
Set the initial backoff interval for the job. See Retries::backoff_initial_interval for more details
Sourcepub fn backoff_multiplier(self, backoff_multiplier: f32) -> Self
pub fn backoff_multiplier(self, backoff_multiplier: f32) -> Self
Set the backoff multiplier for the job. See Retries::backoff_multiplier for more details
Sourcepub fn backoff_randomization(self, backoff_randomization: f32) -> Self
pub fn backoff_randomization(self, backoff_randomization: f32) -> Self
Set the backoff randomization factor for the job. See Retries::backoff_randomization for more details
Sourcepub fn heartbeat_increment(self, heartbeat_increment: Duration) -> Self
pub fn heartbeat_increment(self, heartbeat_increment: Duration) -> Self
Set the heartbeat increment of the job.