Skip to main content

SqliteAgentPoolStore

Struct SqliteAgentPoolStore 

Source
pub struct SqliteAgentPoolStore { /* private fields */ }
Expand description

SQLite-backed implementation of AgentPoolStore.

Two independent SqliteAgentPoolStore values opened against the same database file share pool membership, messages, wake registrations, dedupe, rehydration, and watch cursors. The adapter stores core pool records as JSON and replays them into snapshots; it does not own workflow scheduling or a second event bus.

Implementations§

Source§

impl SqliteAgentPoolStore

Source

pub fn open(path: impl AsRef<Path>) -> Result<Self, AgentError>

Opens or creates a SQLite-backed agent-pool store.

Source

pub fn path(&self) -> &Path

Returns the backing database path.

Trait Implementations§

Source§

impl AgentPoolStore for SqliteAgentPoolStore

Source§

fn open_pool( &self, pool_id: AgentPoolId, config: AgentPoolStoreConfig, ) -> Result<AgentPoolSnapshot, AgentError>

Create or open a logical pool and return the durable snapshot.
Source§

fn snapshot( &self, pool_id: &AgentPoolId, ) -> Result<AgentPoolSnapshot, AgentError>

Rehydrate the current durable pool snapshot.
Source§

fn record_pool_created( &self, pool_id: &AgentPoolId, ) -> Result<AgentPoolStoreCursor, AgentError>

Mark the pool-created lifecycle as durable.
Source§

fn join_member( &self, pool_id: &AgentPoolId, member: AgentPoolMember, ) -> Result<AgentPoolStoreCursor, AgentError>

Persist member join.
Source§

fn leave_member( &self, pool_id: &AgentPoolId, run_id: &RunId, ) -> Result<(AgentPoolMember, AgentPoolStoreCursor), AgentError>

Persist member leave and return the removed member.
Source§

fn message_receipt( &self, pool_id: &AgentPoolId, idempotency_key: &IdempotencyKey, ) -> Result<Option<MessageReceipt>, AgentError>

Look up message dedupe state by idempotency key.
Source§

fn record_message( &self, pool_id: &AgentPoolId, message: RunMessage, receipt: MessageReceipt, ) -> Result<AgentPoolStoreCursor, AgentError>

Persist one message status transition.
Source§

fn wake_registration( &self, pool_id: &AgentPoolId, idempotency_key: &IdempotencyKey, ) -> Result<Option<WakeRegistration>, AgentError>

Look up wake dedupe state by idempotency key.
Source§

fn wake( &self, pool_id: &AgentPoolId, condition_id: &WakeConditionId, ) -> Result<Option<AgentPoolStoredWake>, AgentError>

Look up one stored wake by condition id.
Source§

fn record_wake( &self, pool_id: &AgentPoolId, condition: WakeCondition, compiled_filter: CompiledEventFilter, registration: WakeRegistration, ) -> Result<AgentPoolStoreCursor, AgentError>

Persist one wake status transition.
Source§

fn watch( &self, pool_id: &AgentPoolId, cursor: Option<AgentPoolStoreCursor>, ) -> Result<AgentPoolStoreStream, AgentError>

Read durable pool changes after the supplied cursor.
Source§

fn next_event_sequence(&self, pool_id: &AgentPoolId) -> Result<u64, AgentError>

Allocate a unique event sequence for pool event IDs.
Source§

impl Clone for SqliteAgentPoolStore

Source§

fn clone(&self) -> SqliteAgentPoolStore

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

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> 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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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.