pub struct WorkerRegistry { /* private fields */ }Expand description
Worker registry for persistent storage
Implementations§
Source§impl WorkerRegistry
impl WorkerRegistry
Sourcepub fn new(backend: RegistryBackend) -> Self
pub fn new(backend: RegistryBackend) -> Self
Create a new worker registry
Sourcepub async fn register(
&self,
worker_id: String,
endpoint: WorkerEndpoint,
) -> Result<()>
pub async fn register( &self, worker_id: String, endpoint: WorkerEndpoint, ) -> Result<()>
Register a worker
Sourcepub async fn unregister(&self, worker_id: &str) -> Result<()>
pub async fn unregister(&self, worker_id: &str) -> Result<()>
Unregister a worker
Sourcepub async fn update_heartbeat(&self, worker_id: &str) -> Result<()>
pub async fn update_heartbeat(&self, worker_id: &str) -> Result<()>
Update worker heartbeat
Sourcepub async fn get_all(&self) -> Vec<RegisteredWorker>
pub async fn get_all(&self) -> Vec<RegisteredWorker>
Get all workers
Auto Trait Implementations§
impl !RefUnwindSafe for WorkerRegistry
impl !UnwindSafe for WorkerRegistry
impl Freeze for WorkerRegistry
impl Send for WorkerRegistry
impl Sync for WorkerRegistry
impl Unpin for WorkerRegistry
impl UnsafeUnpin for WorkerRegistry
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> 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>
Wrap the input message
T in a tonic::Request