pub struct SurrealRuntime {
pub job_store: SurrealJobStore,
pub recurring_store: SurrealRecurringStore,
pub outbox_store: SurrealOutboxStore,
pub job_attempt_store: SurrealJobAttemptStore,
/* private fields */
}Fields§
§job_store: SurrealJobStore§recurring_store: SurrealRecurringStore§outbox_store: SurrealOutboxStore§job_attempt_store: SurrealJobAttemptStoreImplementations§
Source§impl SurrealRuntime
impl SurrealRuntime
pub fn new(db: Surreal<Any>) -> Self
pub fn with_dependencies( db: Surreal<Any>, clock: Arc<dyn Clock>, id_generator: Arc<dyn IdGenerator>, ) -> Self
pub fn with_dependencies_and_metrics( db: Surreal<Any>, clock: Arc<dyn Clock>, id_generator: Arc<dyn IdGenerator>, metrics: Arc<dyn RuntimeMetrics>, ) -> Self
pub fn configure_retention_policy(&self, policy: RetentionPolicy) -> Result<()>
pub fn register_handler<H: JobHandler + 'static>( &self, handler: H, ) -> Result<()>
pub fn register_event_publisher<P: EventPublisher + 'static>( &self, publisher: P, ) -> Result<()>
pub fn configure_outbox_publish_policy( &self, policy: OutboxPublishPolicy, ) -> Result<()>
pub async fn enqueue(&self, job: NewJob) -> Result<()>
pub async fn register_recurring( &self, definition: RecurringDefinition, ) -> Result<()>
pub async fn list_job_attempts(&self, job_id: &str) -> Result<Vec<JobAttempt>>
pub async fn list_attempts_by_guardrail_code( &self, guardrail_code: &str, ) -> Result<Vec<JobAttempt>>
pub async fn list_attempts_by_execution_id( &self, execution_id: &str, ) -> Result<Vec<JobAttempt>>
pub async fn list_lineage_events( &self, job_id: &str, ) -> Result<Vec<OutboxEvent>>
pub async fn list_lineage_events_by_execution_id( &self, execution_id: &str, ) -> Result<Vec<OutboxEvent>>
pub async fn list_lineage_events_by_thread_id( &self, thread_id: &str, ) -> Result<Vec<OutboxEvent>>
pub async fn investigate_lineage( &self, query: RuntimeLineageQuery, ) -> Result<RuntimeLineageReport>
pub async fn get_replay_report(&self, job_id: &str) -> Result<ReplayReport>
pub async fn process_once_now( &self, queue: &str, worker_id: &str, ) -> Result<Option<String>>
pub async fn replay_dead_letter_now(&self, job_id: &str) -> Result<bool>
pub async fn publish_pending_events_now(&self, limit: usize) -> Result<usize>
pub async fn materialize_recurring_now( &self, scheduler_id: &str, ) -> Result<usize>
pub async fn prune_terminal_records( &self, cutoff: DateTime<Utc>, ) -> Result<RetentionPruneReport>
pub async fn enforce_retention( &self, now: DateTime<Utc>, ) -> Result<RetentionPruneReport>
pub async fn enforce_retention_now(&self) -> Result<RetentionPruneReport>
pub async fn materialize_recurring( &self, now: DateTime<Utc>, scheduler_id: &str, ) -> Result<usize>
pub async fn process_once( &self, queue: &str, worker_id: &str, now: DateTime<Utc>, ) -> Result<Option<String>>
pub async fn replay_dead_letter( &self, job_id: &str, now: DateTime<Utc>, ) -> Result<bool>
pub async fn publish_pending_events( &self, limit: usize, now: DateTime<Utc>, ) -> Result<usize>
Trait Implementations§
Source§impl Clone for SurrealRuntime
impl Clone for SurrealRuntime
Source§fn clone(&self) -> SurrealRuntime
fn clone(&self) -> SurrealRuntime
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 moreAuto Trait Implementations§
impl Freeze for SurrealRuntime
impl !RefUnwindSafe for SurrealRuntime
impl Send for SurrealRuntime
impl Sync for SurrealRuntime
impl Unpin for SurrealRuntime
impl UnsafeUnpin for SurrealRuntime
impl !UnwindSafe for SurrealRuntime
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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