use async_trait::async_trait;
use tokio::sync::mpsc;
use rskit_errors::AppResult;
use crate::instance::ServiceInstance;
#[async_trait]
pub trait Discovery: Send + Sync {
async fn resolve(&self, service: &str) -> AppResult<Vec<ServiceInstance>>;
}
#[async_trait]
pub trait Registry: Send + Sync {
async fn register(&self, instance: &ServiceInstance) -> AppResult<()>;
async fn deregister(&self, id: &str) -> AppResult<()>;
}
#[async_trait]
pub trait Watcher: Send + Sync {
async fn watch(&self, service: &str) -> AppResult<mpsc::Receiver<Vec<ServiceInstance>>>;
}