Module msgbus

Source
Expand description

A common in-memory MessageBus supporting multiple messaging patterns:

  • Point-to-Point
  • Pub/Sub
  • Request/Response

Re-exports§

pub use crate::msgbus::message::BusMessage;

Modules§

database
handler
Message handler functionality for the message bus system.
listener
message
stubs
switchboard

Structs§

MessageBus
A generic message bus to facilitate various messaging patterns.
ShareableMessageBus
Subscription
Represents a subscription to a particular topic.

Functions§

deregister
Deregisters the handler for the endpoint address.
get_message_bus
Gets the global message bus.
is_matching
Match a topic and a string pattern pattern can contains - ‘*’ - match 0 or more characters after this ‘?’ - match any character once ‘a-z’ - match the specific character
is_subscribed
publish
Publishes the message to the topic.
register
Registers the handler for the endpoint address.
response
Sends the response to the handler registered for the correlation_id (if found).
send
Sends the message to the endpoint.
set_message_bus
Sets the global message bus.
subscribe
Subscribes the given handler to the topic with an optional priority.
subscriptions_count
unsubscribe
Unsubscribes the handler from the topic.