18 lines
342 B
Python
18 lines
342 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Protocol
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class DeliveryResult:
|
|
ok: bool
|
|
permanent: bool = False
|
|
error: str | None = None
|
|
|
|
|
|
class Notifier(Protocol):
|
|
name: str
|
|
|
|
async def deliver(self, event_type: str, payload: dict) -> DeliveryResult: ...
|