Coverage for portality / events / consumer.py: 75%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-05 00:09 +0100

1class EventConsumer(object): 

2 # subclass must provide an ID 

3 ID = None 

4 

5 @classmethod 

6 def should_consume(cls, event) -> bool: 

7 """ 

8 Determine whether this consumer should consume the given event 

9 """ 

10 raise NotImplementedError() 

11 

12 @classmethod 

13 def consume(cls, event) -> None: 

14 """ 

15 run operation to consume and handle the event 

16 """ 

17 raise NotImplementedError()