pub struct SqliteClaimStore { /* private fields */ }Expand description
SQLite-backed ClaimPort with BEGIN IMMEDIATE CAS claiming.
Implementations§
Source§impl SqliteClaimStore
impl SqliteClaimStore
Sourcepub fn open(path: &str) -> Result<Self, StoreError>
pub fn open(path: &str) -> Result<Self, StoreError>
Open (or create) a claim store at the given file path.
Sourcepub fn open_in_memory() -> Result<Self, StoreError>
pub fn open_in_memory() -> Result<Self, StoreError>
Open a transient in-memory store (useful in tests).
Trait Implementations§
Source§impl ClaimPort for SqliteClaimStore
impl ClaimPort for SqliteClaimStore
Source§type Error = StoreError
type Error = StoreError
Error type returned by store operations.
Source§fn enqueue(&self, queue: &str, body: &str) -> Result<Uuid, StoreError>
fn enqueue(&self, queue: &str, body: &str) -> Result<Uuid, StoreError>
Enqueue a new pending item; returns its id. Read more
Source§fn claim_next(
&self,
queue: &str,
worker_id: &str,
) -> Result<Option<WorkItem>, StoreError>
fn claim_next( &self, queue: &str, worker_id: &str, ) -> Result<Option<WorkItem>, StoreError>
Source§fn is_near_duplicate(&self, queue: &str, body: &str) -> Result<bool, StoreError>
fn is_near_duplicate(&self, queue: &str, body: &str) -> Result<bool, StoreError>
Returns
true if body is a near-duplicate of an existing item.Auto Trait Implementations§
impl !Freeze for SqliteClaimStore
impl RefUnwindSafe for SqliteClaimStore
impl Send for SqliteClaimStore
impl Sync for SqliteClaimStore
impl Unpin for SqliteClaimStore
impl UnsafeUnpin for SqliteClaimStore
impl UnwindSafe for SqliteClaimStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more