[−][src]Struct faktory::Job
A Faktory job.
See also the Faktory wiki.
Fields
queue: String
The queue this job belongs to. Usually default
.
created_at: Option<DateTime<Utc>>
When this job was created.
enqueued_at: Option<DateTime<Utc>>
When this job was supplied to the Faktory server.
at: Option<DateTime<Utc>>
When this job is scheduled for.
Defaults to immediately.
reserve_for: Option<usize>
How long to allow this job to run for.
Defaults to 600 seconds.
retry: Option<isize>
Number of times to retry this job.
Defaults to 25.
priority: Option<u8>
The priority of this job from 1-9 (9 is highest).
Pushing a job with priority 9 will effectively put it at the front of the queue. Defaults to 5.
backtrace: Option<usize>
Number of lines of backtrace to keep if this job fails.
Defaults to 0.
custom: HashMap<String, Value>
Extra context to include with the job.
Faktory workers can have plugins and middleware which need to store additional context with the job payload. Faktory supports a custom hash to store arbitrary key/values in the JSON. This can be extremely helpful for cross-cutting concerns which should propagate between systems, e.g. locale for user-specific text translations, request_id for tracing execution across a complex distributed system, etc.
Methods
impl Job
[src]
pub fn new<S, A>(kind: S, args: Vec<A>) -> Self where
S: Into<String>,
A: Into<Value>,
[src]
S: Into<String>,
A: Into<Value>,
Create a new job of type kind
, with the given arguments.
pub fn on_queue<S: Into<String>>(self, queue: S) -> Self
[src]
Place this job on the given queue
.
If this method is not called (or self.queue
set otherwise), the queue will be set to
"default".
pub fn id(&self) -> &str
[src]
This job's id.
pub fn kind(&self) -> &str
[src]
This job's type.
pub fn args(&self) -> &[Value]
[src]
The arguments provided for this job.
Trait Implementations
impl Debug for Job
[src]
impl<'de> Deserialize<'de> for Job
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Job
[src]
Auto Trait Implementations
impl RefUnwindSafe for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl UnwindSafe for Job
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,