esdee/dispatcher
A utility for dispatching service types and descriptions and managing related subscriptions.
Types
pub opaque type Dispatcher
Values
pub fn dispatch(
dispatcher: Dispatcher,
update: esdee.ServiceDiscveryUpdate,
) -> Nil
Dispatches the service discovery update to all relevant subscribers.
pub fn new() -> Dispatcher
pub fn subscribe_to_service_details(
dispatcher: Dispatcher,
service_type: String,
subject: process.Subject(esdee.ServiceDescription),
) -> Dispatcher
Subscribes the given subject to discovered service details of the given type. Calling this multiple times with the same subject does not produce multiple subscriptions.
pub fn subscribe_to_service_types(
dispatcher: Dispatcher,
subject: process.Subject(String),
) -> Dispatcher
Subscribes the given subject to discovered service types. Calling this multiple times with the same subject does not produce multiple subscriptions.
pub fn unsubscribe_from_service_details(
dispatcher: Dispatcher,
service_type: String,
subject: process.Subject(esdee.ServiceDescription),
) -> Dispatcher
Unsubscribes the given subject from receiving details for the given service type.
pub fn unsubscribe_from_service_types(
dispatcher: Dispatcher,
subject: process.Subject(String),
) -> Dispatcher
Unsubscribes the given subject from discovered service types.