pub struct WorkerActivityDispatcher { /* private fields */ }Expand description
Dispatcher that routes run_activity NIF calls to connected workers.
Synchronous interface — uses try_send for the task channel and
std::sync::mpsc::Receiver::recv for the response. Callers on a
multi-thread tokio runtime are detected and moved into
tokio::task::block_in_place so the blocking wait never starves the
runtime tasks that flush the worker stream (see the module docs).
Implementations§
Source§impl WorkerActivityDispatcher
impl WorkerActivityDispatcher
Sourcepub fn new(
registry: ConnectedWorkerRegistry,
namespace: impl Into<String>,
heartbeat_tracker: HeartbeatTracker,
) -> Self
pub fn new( registry: ConnectedWorkerRegistry, namespace: impl Into<String>, heartbeat_tracker: HeartbeatTracker, ) -> Self
Build a dispatcher for the given namespace, worker registry, and liveness tracker.
The tracker must be the same instance the worker stream handler and shutdown coordinator share: the unbounded completion wait relies on stream teardown sweeping this tracker’s in-flight entries to fail dispatches whose worker was lost.
Sourcepub fn with_queue_service(self, queue_service: QueueServiceConfig) -> Self
pub fn with_queue_service(self, queue_service: QueueServiceConfig) -> Self
Share the operator’s R1 queue-service settings: the default policy, the
written per-queue durable_pending opt-ins, and the two clocks.
Sourcepub fn with_queue_declarations(
self,
queue_declarations: QueueDeclarationSource,
) -> Self
pub fn with_queue_declarations( self, queue_declarations: QueueDeclarationSource, ) -> Self
Share the queue-declaration source the boot path fills in once the engine exists (the handle is cloneable; installing on any clone is visible here).
Sourcepub fn with_queue_state(self, queue_state: QueueServiceState) -> Self
pub fn with_queue_state(self, queue_state: QueueServiceState) -> Self
Share the queue-service state so the server can read which addresses are unserved and which runs are parked on them.
Sourcepub fn with_attempt_owners(self, attempt_owners: AttemptOwnerIndex) -> Self
pub fn with_attempt_owners(self, attempt_owners: AttemptOwnerIndex) -> Self
Share the server’s NOI-6 attempt→owner back-index so liminal-delivered
dispatches are visible (and targetable) to the intervention router for
exactly as long as they are in flight. The production boot passes
ServerState’s index — the SAME instance intervenable_attempts and
intervene read — or the console’s live-attempts list stays empty for
every bridge-dispatched agent step.
Sourcepub fn with_pending(self, pending: PendingActivities) -> Self
pub fn with_pending(self, pending: PendingActivities) -> Self
Share a caller-supplied pending-activities tracker.
Sourcepub fn with_drain_state(self, drain_state: DrainState) -> Self
pub fn with_drain_state(self, drain_state: DrainState) -> Self
Share the server drain gate.
Sourcepub fn with_tokio_handle(self, tokio_handle: Handle) -> Self
pub fn with_tokio_handle(self, tokio_handle: Handle) -> Self
Share the server runtime handle for sync history writes from dirty NIF threads.
Trait Implementations§
Source§impl ActivityDispatcher for WorkerActivityDispatcher
impl ActivityDispatcher for WorkerActivityDispatcher
Auto Trait Implementations§
impl !RefUnwindSafe for WorkerActivityDispatcher
impl !UnwindSafe for WorkerActivityDispatcher
impl Freeze for WorkerActivityDispatcher
impl Send for WorkerActivityDispatcher
impl Sync for WorkerActivityDispatcher
impl Unpin for WorkerActivityDispatcher
impl UnsafeUnpin for WorkerActivityDispatcher
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
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>
T in a tonic::Request