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

1"""Module for defining an interface for a publisher. 

2 

3A publisher should publish events to an event bus. 

4""" 

5 

6from abc import abstractmethod 

7 

8from kwai.core.events.event import Event 

9 

10 

11class Publisher: 

12 """Interface for a publisher.""" 

13 

14 @abstractmethod 

15 async def publish(self, event: Event): 

16 """Publish an event."""