Skip to main content

QueueReplicateOp

Enum QueueReplicateOp 

Source
pub enum QueueReplicateOp {
    Enqueue {
        job_id: u64,
        payload: Vec<u8>,
        enqueued_at_ms: u64,
        next_job_id: u64,
        priority: u8,
        not_before_ms: u64,
        dedup_key: Option<Vec<u8>>,
        attempts: u32,
        max_attempts: u32,
    },
    Lease {
        lease_id: u64,
        job_id: u64,
        worker_node: u64,
        worker_instance: u32,
        expires_at_ms: u64,
        next_lease_id: u64,
    },
    Ack {
        lease_id: u64,
        job_id: u64,
    },
    Nack {
        lease_id: u64,
        job_id: u64,
        attempts: u32,
        dead_letter: bool,
        not_before_ms: u64,
    },
    Reclaim {
        lease_id: u64,
        job_id: u64,
        attempts: u32,
        dead_letter: bool,
        not_before_ms: u64,
    },
    RequeueDeadLetter {
        job_id: u64,
        attempts: u32,
    },
    UpsertSchedule {
        schedule: RecurringScheduleWire,
    },
    UpdateScheduleNextRun {
        name: String,
        next_run_ms: u64,
    },
}
Expand description

Idempotent state transition replicated from the queue leader to every voter (POST /raft/v1/queue/replicate).

Variants§

§

Enqueue

Append a job and advance the stream’s next_job_id.

Fields

§job_id: u64

Assigned job id.

§payload: Vec<u8>

Job body.

§enqueued_at_ms: u64

Leader wall time at enqueue (unix ms).

§next_job_id: u64

Monotonic id generator after this enqueue.

§priority: u8

Lease priority (higher first).

§not_before_ms: u64

Earliest lease time (unix ms).

§dedup_key: Option<Vec<u8>>

Optional dedup key index update.

§attempts: u32

Attempts already recorded for this job.

§max_attempts: u32

Retry ceiling (0 = unlimited).

§

Lease

Move a job from pending to leased.

Fields

§lease_id: u64

New lease token.

§job_id: u64

Job being leased.

§worker_node: u64

Worker node id.

§worker_instance: u32

Worker instance id.

§expires_at_ms: u64

Lease expiry (unix ms; followers may use local timeout).

§next_lease_id: u64

Monotonic lease id generator after this lease.

§

Ack

Job completed — remove job and lease rows.

Fields

§lease_id: u64

Released lease.

§job_id: u64

Completed job.

§

Nack

Worker rejected the job — return to pending or dead letter.

Fields

§lease_id: u64

Released lease.

§job_id: u64

Requeued or dead-lettered job.

§attempts: u32

Attempt count after this failure.

§dead_letter: bool

When true the job is in the dead-letter set, not pending.

§not_before_ms: u64

Earliest re-lease time (unix ms) when requeued.

§

Reclaim

Visibility timeout expired — job returns to pending or dead letter.

Fields

§lease_id: u64

Expired lease.

§job_id: u64

Requeued or dead-lettered job.

§attempts: u32

Attempt count after this failure.

§dead_letter: bool

When true the job is in the dead-letter set, not pending.

§not_before_ms: u64

Earliest re-lease time (unix ms) when requeued.

§

RequeueDeadLetter

Operator moved a dead-letter job back to pending.

Fields

§job_id: u64

Job id to retry.

§attempts: u32

Reset attempt counter (usually 0).

§

UpsertSchedule

Upsert a cron schedule (builder / operator).

Fields

§schedule: RecurringScheduleWire

Schedule body.

§

UpdateScheduleNextRun

Leader advanced a schedule after enqueueing its tick.

Fields

§name: String

Schedule name within the stream.

§next_run_ms: u64

Next fire time (unix ms).

Trait Implementations§

Source§

impl Clone for QueueReplicateOp

Source§

fn clone(&self) -> QueueReplicateOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QueueReplicateOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for QueueReplicateOp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for QueueReplicateOp

Source§

impl PartialEq for QueueReplicateOp

Source§

fn eq(&self, other: &QueueReplicateOp) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for QueueReplicateOp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for QueueReplicateOp

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.