pub struct Executor {
pub registry: Arc<ScriptRegistry>,
pub context_factory: Arc<dyn ContextFactory>,
pub telemetry: Arc<dyn TelemetrySink>,
/* private fields */
}Expand description
Executor for running registered scripts against scheduled jobs.
Constructed by ChrononBuilder in chronon-runtime and called when workers claim runs.
Fields§
§registry: Arc<ScriptRegistry>Script catalog used to resolve handler functions by name.
context_factory: Arc<dyn ContextFactory>Rebuilds ScriptContext from job actor_json.
telemetry: Arc<dyn TelemetrySink>Metrics and structured error events for invoke phases.
Implementations§
Source§impl Executor
impl Executor
Sourcepub fn new(
registry: Arc<ScriptRegistry>,
context_factory: Arc<dyn ContextFactory>,
telemetry: Arc<dyn TelemetrySink>,
event_tx: UnboundedSender<ExecutorEvent>,
) -> Executor
pub fn new( registry: Arc<ScriptRegistry>, context_factory: Arc<dyn ContextFactory>, telemetry: Arc<dyn TelemetrySink>, event_tx: UnboundedSender<ExecutorEvent>, ) -> Executor
Builds an executor wired to the given registry, factory, telemetry, and event channel.
The runtime typically clones Self::event_sender before passing event_tx so both
sides can send lifecycle updates.
Sourcepub fn event_sender(&self) -> UnboundedSender<ExecutorEvent>
pub fn event_sender(&self) -> UnboundedSender<ExecutorEvent>
Clones the unbounded sender for ExecutorEvent lifecycle updates.
Used by the runtime to subscribe without holding an Executor reference.
Sourcepub fn script_count(&self) -> usize
pub fn script_count(&self) -> usize
Returns the number of scripts currently registered.
Sourcepub fn spawn_run(&self, job: &Job, run: Run)
pub fn spawn_run(&self, job: &Job, run: Run)
Spawn asynchronous execution for one run of the given job.
Emits ExecutorEvent::RunStarted immediately, then invokes the script via
execute_script. Run params_json takes precedence over job defaults.
Auto Trait Implementations§
impl !RefUnwindSafe for Executor
impl !UnwindSafe for Executor
impl Freeze for Executor
impl Send for Executor
impl Sync for Executor
impl Unpin for Executor
impl UnsafeUnpin for Executor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
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>
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 more