pub struct LocalScheduleStore { /* private fields */ }Expand description
SQLite-backed schedule store for local embedded hosts.
Implementations§
Source§impl LocalScheduleStore
impl LocalScheduleStore
Sourcepub fn new(
db: SqliteDb,
org_id: i64,
owner_principal_id: PrincipalId,
) -> Result<Self>
pub fn new( db: SqliteDb, org_id: i64, owner_principal_id: PrincipalId, ) -> Result<Self>
Open (and migrate) a schedule store over db, scoped to org_id.
Sourcepub async fn create_schedule_with_metadata(
&self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
metadata: Value,
) -> Result<SessionSchedule>
pub async fn create_schedule_with_metadata( &self, session_id: SessionId, description: String, cron_expression: Option<String>, scheduled_at: Option<DateTime<Utc>>, timezone: String, metadata: Value, ) -> Result<SessionSchedule>
Create a schedule and persist caller-supplied extra fields in the local
metadata column. This is the additive seam that satisfies the
“extensible metadata bag” criterion without changing the core primitive.
Sourcepub async fn get_metadata(
&self,
schedule_id: ScheduleId,
) -> Result<Option<Value>>
pub async fn get_metadata( &self, schedule_id: ScheduleId, ) -> Result<Option<Value>>
Read back the metadata bag previously stored for a schedule. Returns
None when the schedule does not exist in this org scope.
Trait Implementations§
Source§impl Clone for LocalScheduleStore
impl Clone for LocalScheduleStore
Source§fn clone(&self) -> LocalScheduleStore
fn clone(&self) -> LocalScheduleStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl SessionScheduleStore for LocalScheduleStore
impl SessionScheduleStore for LocalScheduleStore
Source§fn create_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_schedule<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
description: String,
cron_expression: Option<String>,
scheduled_at: Option<DateTime<Utc>>,
timezone: String,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Create a new schedule for a session.
Source§fn cancel_schedule<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
schedule_id: ScheduleId,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_schedule<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
schedule_id: ScheduleId,
) -> Pin<Box<dyn Future<Output = Result<SessionSchedule>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancel (disable) a schedule.
Source§fn list_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<Vec<SessionSchedule>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List schedules for a session.
Source§fn count_active_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_active_schedules<'life0, 'async_trait>(
&'life0 self,
session_id: SessionId,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count active (enabled) schedules for a session.
Source§fn count_active_org_schedules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_active_org_schedules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count active (enabled) schedules across the whole org this store is
scoped to. Used to enforce a per-org cap independent of session count:
count_active_schedules only bounds one session, so unlimited sessions
would otherwise imply unlimited active schedules per org.Auto Trait Implementations§
impl !RefUnwindSafe for LocalScheduleStore
impl !UnwindSafe for LocalScheduleStore
impl Freeze for LocalScheduleStore
impl Send for LocalScheduleStore
impl Sync for LocalScheduleStore
impl Unpin for LocalScheduleStore
impl UnsafeUnpin for LocalScheduleStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request