Also known as implicit invocaton. Used when components producing data/events do not directly know which other components will consume them.

The goal here is a “message broadcast” to multiple consumers. One published event can be consumed by multiple independent subscribers. This is used in event driven architecture.

Components

  • Publishers emit events and messages
  • Subscribers register interest and react
  • Connectors are the events and messages grouped by topic

This is used by ROS nodes.

Warning

The risk here is duplication. A message can be read or acted upon multiple times by different consumers since they are independent.

This is inherently a messaging pattern and related to Message Queue.

Pros and Cons

Pros:

  • You can add and remove subscribers without changing publishers
  • Async delivery and buffering can be scaled to handle spikes Cons:
  • Hidden dependencies between components and unpredictable timing is a detriment to readability
  • Debugging needs tracing and structured logging

Variants

Event based:

  • Introduces a shared event bus, this is the pub sub that we thing of