notice

This is documentation for Rasa Open Source Documentation v2.3.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.5.x).

Version: 2.3.x

rasa.core.brokers.broker

EventBroker Objects

class EventBroker()

Base class for any event broker implementation.

create

| @staticmethod
| async create(obj: Union["EventBroker", EndpointConfig, None], loop: Optional[AbstractEventLoop] = None) -> Optional["EventBroker"]

Factory to create an event broker.

from_endpoint_config

| @classmethod
| async from_endpoint_config(cls, broker_config: EndpointConfig, event_loop: Optional[AbstractEventLoop] = None) -> "EventBroker"

Creates an EventBroker from the endpoint configuration.

Arguments:

  • broker_config - The configuration for the broker.
  • event_loop - The current event loop or None.

Returns:

An EventBroker object.

publish

| publish(event: Dict[Text, Any]) -> None

Publishes a json-formatted Rasa Core event into an event queue.

is_ready

| is_ready() -> bool

Determine whether or not the event broker is ready.

Returns:

True by default, but this may be overridden by subclasses.

close

| async close() -> None

Close the connection to an event broker.