Skip to main content

Crate objsds_queue

Crate objsds_queue 

Source
Expand description

A blocking, brokerless work queue stored in one object.

Every operation reads the complete JSON document. Mutations conditionally replace it using the objsds_store::ObjectStore version token, so concurrent mutations can return Error::Conflict and are never retried automatically. CPU, memory, and transfer costs are O(n) in queue size.

Successful publication makes a message available at least once. A claim grants one time-bounded lease; an unacknowledged message becomes claimable again when that lease expires. Acknowledgement permanently removes the message only when its current lease token matches and has not expired. Ack::NotFound, Ack::LeaseMismatch, and Ack::LeaseExpired are classifications of the snapshot that was read; they are not written back. Only Ack::Acknowledged is made durable with a successful compare-and-swap. Consequently handlers must be idempotent: a worker can finish its side effect and fail before acknowledgement, and lease expiry can allow another worker to process the same message. There is no exactly-once delivery, broker, consumer group, group commit, long polling, or automatic retry. Clock synchronization bounds lease safety across processes.

Structs§

Claim
A message claimed for processing until its lease deadline.
LeaseToken
Opaque token authorizing acknowledgement of one claim.
MessageId
Opaque identifier assigned to one published message.
Queue
A brokerless queue occupying exactly one object.
QueueBuilder
Configures and opens one queue.
SystemClock
Wall clock used by default.

Enums§

Ack
Outcome of an acknowledgement attempt.
BuildError
Queue construction error.
Error
A queue operation error.

Traits§

Clock
Supplies Unix time in milliseconds for lease decisions.