Skip to content

Notifier

Outbound port defining an asynchronous notification service.

A Notifier provides an abstraction for sending notification messages using
external delivery channels such as email, SMS, chat systems, or push
notifications.

Responsibilities:
- Send notification messages asynchronously.

Non-Responsibilities:
- Guarantee delivery.
- Implement retries or throttling unless defined by infrastructure.

notifier

Outbound port defining an asynchronous notification service.

A Notifier provides an abstraction for sending notification messages using
external delivery channels such as email, SMS, chat systems, or push
notifications.

Responsibilities
  • Send notification messages asynchronously.
Non-Responsibilities
  • Guarantee delivery.
  • Implement retries or throttling unless defined by infrastructure.

Notifier

Bases: OutboundPort[NotificationType, None], Generic[NotificationType], Protocol

Outbound port for sending asynchronous notifications.

Implementers integrate with concrete notification systems. The
application layer must not depend on infrastructure details beyond this
abstraction.

Source code in src/forging_blocks/application/ports/outbound/notifier.py
class Notifier(
    OutboundPort[NotificationType, None], Generic[NotificationType], Protocol
):
    """Outbound port for sending asynchronous notifications.

    Implementers integrate with concrete notification systems. The
    application layer must not depend on infrastructure details beyond this
    abstraction.
    """

    async def notify(self, message: NotificationType) -> None:
        """Send a notification.

        Args:
            message: The message to deliver.

        Notes:
            - Fire-and-forget behavior unless documented otherwise.
            - Delivery semantics are infrastructure-defined.
        """
        ...

notify(message: NotificationType) -> None async

Send a notification.

Parameters:

Name Type Description Default
message NotificationType

The message to deliver.

required
Notes
  • Fire-and-forget behavior unless documented otherwise.
  • Delivery semantics are infrastructure-defined.
Source code in src/forging_blocks/application/ports/outbound/notifier.py
async def notify(self, message: NotificationType) -> None:
    """Send a notification.

    Args:
        message: The message to deliver.

    Notes:
        - Fire-and-forget behavior unless documented otherwise.
        - Delivery semantics are infrastructure-defined.
    """
    ...