pub struct ClientWorkerSet { /* private fields */ }Expand description
Enables local workers to make themselves visible to a shared client instance.
For slot managing, there can only be one worker registered per namespace+queue_name+connection, others will return an error. It also provides a convenient method to find compatible slots within the collection.
Implementations§
Source§impl ClientWorkerSet
impl ClientWorkerSet
Sourcepub fn register_worker(
&self,
worker: Arc<dyn ClientWorker + Send + Sync>,
skip_client_worker_set_check: bool,
) -> Result<(), Error>
pub fn register_worker( &self, worker: Arc<dyn ClientWorker + Send + Sync>, skip_client_worker_set_check: bool, ) -> Result<(), Error>
Register a local worker that can provide WFT processing slots and potentially worker heartbeating.
Sourcepub fn unregister_slot_provider(
&self,
worker_instance_key: Uuid,
) -> Result<(), Error>
pub fn unregister_slot_provider( &self, worker_instance_key: Uuid, ) -> Result<(), Error>
Disables Eager Workflow Start for this worker. This must be called before
finalize_unregister, otherwise finalize_unregister will return an err.
Sourcepub fn finalize_unregister(
&self,
worker_instance_key: Uuid,
) -> Result<Arc<dyn ClientWorker + Send + Sync>, Error>
pub fn finalize_unregister( &self, worker_instance_key: Uuid, ) -> Result<Arc<dyn ClientWorker + Send + Sync>, Error>
Finalizes unregistering of worker from client. This must be called at the end of worker
shutdown in order to finalize shutdown for worker heartbeat properly. Must call after
unregister_slot_provider, otherwise an err will be returned.
Sourcepub fn worker_grouping_key(&self) -> Uuid
pub fn worker_grouping_key(&self) -> Uuid
Returns the worker grouping key, which is unique for each worker.
Trait Implementations§
Source§impl Debug for ClientWorkerSet
impl Debug for ClientWorkerSet
Auto Trait Implementations§
impl !Freeze for ClientWorkerSet
impl !RefUnwindSafe for ClientWorkerSet
impl Send for ClientWorkerSet
impl Sync for ClientWorkerSet
impl Unpin for ClientWorkerSet
impl UnsafeUnpin for ClientWorkerSet
impl !UnwindSafe for ClientWorkerSet
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
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