Coverage for src/kwai/core/events/publisher.py: 100%
3 statements
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
1"""Module for defining an interface for a publisher.
3A publisher should publish events to an event bus.
4"""
6from abc import abstractmethod
8from kwai.core.events.event import Event
11class Publisher:
12 """Interface for a publisher."""
14 @abstractmethod
15 async def publish(self, event: Event):
16 """Publish an event."""