pub trait WorkerRegistry:
Send
+ Sync
+ 'static {
// Required methods
fn register(
&self,
worker_id: &str,
labels: &[String],
) -> impl Future<Output = Result<(), RegistryError>> + Send;
fn heartbeat(
&self,
worker_id: &str,
) -> impl Future<Output = Result<(), RegistryError>> + Send;
fn deregister(
&self,
worker_id: &str,
) -> impl Future<Output = Result<(), RegistryError>> + Send;
fn list_workers(
&self,
) -> impl Future<Output = Result<Vec<WorkerInfo>, RegistryError>> + Send;
fn mark_busy(
&self,
worker_id: &str,
job_id: &str,
) -> impl Future<Output = Result<(), RegistryError>> + Send;
fn mark_idle(
&self,
worker_id: &str,
) -> impl Future<Output = Result<(), RegistryError>> + Send;
}Expand description
Registry of connected workers and their capabilities.
Used for monitoring and matching jobs to capable workers.
Required Methods§
Sourcefn register(
&self,
worker_id: &str,
labels: &[String],
) -> impl Future<Output = Result<(), RegistryError>> + Send
fn register( &self, worker_id: &str, labels: &[String], ) -> impl Future<Output = Result<(), RegistryError>> + Send
Register a worker with its capability labels.
Sourcefn heartbeat(
&self,
worker_id: &str,
) -> impl Future<Output = Result<(), RegistryError>> + Send
fn heartbeat( &self, worker_id: &str, ) -> impl Future<Output = Result<(), RegistryError>> + Send
Record a heartbeat from a worker.
Sourcefn deregister(
&self,
worker_id: &str,
) -> impl Future<Output = Result<(), RegistryError>> + Send
fn deregister( &self, worker_id: &str, ) -> impl Future<Output = Result<(), RegistryError>> + Send
Remove a worker from the registry.
Sourcefn list_workers(
&self,
) -> impl Future<Output = Result<Vec<WorkerInfo>, RegistryError>> + Send
fn list_workers( &self, ) -> impl Future<Output = Result<Vec<WorkerInfo>, RegistryError>> + Send
List all registered workers.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".