9 lines
370 B
Python
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()}')
|