2023-04-10 14:48:41 +02:00

9 lines
370 B
Python

class BaseRouter:
def post_message(self, namespace: bytes, topic: bytes, kind: bytes, body: bytes) -> None:
raise NotImplementedError
class StdOutRouter(BaseRouter):
def post_message(self, namespace: bytes, topic: bytes, kind: bytes, body: bytes) -> None:
print(f'ns={namespace.decode()},t={topic.decode()},k={kind.decode()} {body.decode()}')