pub trait SharedNamespaceWorkerTrait {
// Required methods
fn namespace(&self) -> String;
fn register_callback(
&self,
worker_instance_key: Uuid,
callbacks: WorkerCallbacks,
);
fn unregister_callback(
&self,
worker_instance_key: Uuid,
) -> (Option<WorkerCallbacks>, bool);
fn num_workers(&self) -> usize;
// Provided method
fn worker_control_task_queue_enabled(&self) -> bool { ... }
}Expand description
This trait represents a shared namespace worker that sends worker heartbeats and receives worker commands.
Required Methods§
Sourcefn register_callback(
&self,
worker_instance_key: Uuid,
callbacks: WorkerCallbacks,
)
fn register_callback( &self, worker_instance_key: Uuid, callbacks: WorkerCallbacks, )
Registers worker callbacks.
Sourcefn unregister_callback(
&self,
worker_instance_key: Uuid,
) -> (Option<WorkerCallbacks>, bool)
fn unregister_callback( &self, worker_instance_key: Uuid, ) -> (Option<WorkerCallbacks>, bool)
Unregisters worker callbacks. Returns the callbacks removed, as well as a bool that indicates if there are no remaining callbacks in the SharedNamespaceWorker, indicating the shared worker itself can be shut down.
Sourcefn num_workers(&self) -> usize
fn num_workers(&self) -> usize
Returns the number of workers registered to this shared worker.
Provided Methods§
Sourcefn worker_control_task_queue_enabled(&self) -> bool
fn worker_control_task_queue_enabled(&self) -> bool
Returns whether this shared worker is polling the worker control task queue.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".