srne-mqtt/srnemqtt/consumers/stdio.py

18 lines
393 B
Python
Raw Normal View History

2023-01-07 17:59:36 +00:00
# -*- coding: utf-8 -*-
import json
from typing import Any, Dict
from ..srne import Srne
2023-01-07 17:59:36 +00:00
from . import BaseConsumer
class StdoutConsumer(BaseConsumer):
def __init__(self, settings: Dict[str, Any], srne: Srne) -> None:
super().__init__(settings, srne)
2023-01-07 17:59:36 +00:00
def poll(self):
return super().poll()
def write(self, data: Dict[str, Any]):
print(json.dumps(data))