pub struct DiscoveryService { /* private fields */ }Expand description
Worker discovery service
Implementations§
Source§impl DiscoveryService
impl DiscoveryService
Sourcepub fn new(method: DiscoveryMethod, config: DiscoveryConfig) -> Self
pub fn new(method: DiscoveryMethod, config: DiscoveryConfig) -> Self
Create a new discovery service
Sourcepub fn register_worker(&self, endpoint: WorkerEndpoint) -> Result<()>
pub fn register_worker(&self, endpoint: WorkerEndpoint) -> Result<()>
Register a worker manually
Sourcepub fn unregister_worker(&self, worker_id: &str) -> Result<()>
pub fn unregister_worker(&self, worker_id: &str) -> Result<()>
Unregister a worker
Sourcepub fn get_workers(&self) -> Vec<WorkerEndpoint>
pub fn get_workers(&self) -> Vec<WorkerEndpoint>
Get all discovered workers
Sourcepub fn get_healthy_workers(&self) -> Vec<WorkerEndpoint>
pub fn get_healthy_workers(&self) -> Vec<WorkerEndpoint>
Get healthy workers
Sourcepub fn get_worker(&self, worker_id: &str) -> Option<WorkerEndpoint>
pub fn get_worker(&self, worker_id: &str) -> Option<WorkerEndpoint>
Get worker by ID
Sourcepub fn find_workers_by_capability(
&self,
required_codec: &str,
) -> Vec<WorkerEndpoint>
pub fn find_workers_by_capability( &self, required_codec: &str, ) -> Vec<WorkerEndpoint>
Find workers by capability
Sourcepub fn find_workers_by_region(&self, region: &str) -> Vec<WorkerEndpoint>
pub fn find_workers_by_region(&self, region: &str) -> Vec<WorkerEndpoint>
Find workers by location
Sourcepub fn get_capacity_stats(&self) -> CapacityStats
pub fn get_capacity_stats(&self) -> CapacityStats
Get capacity statistics
Auto Trait Implementations§
impl !RefUnwindSafe for DiscoveryService
impl !UnwindSafe for DiscoveryService
impl Freeze for DiscoveryService
impl Send for DiscoveryService
impl Sync for DiscoveryService
impl Unpin for DiscoveryService
impl UnsafeUnpin for DiscoveryService
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