| 123456789101112131415161718192021 | # -*- coding: utf-8 -*-# (c) Nelen & Schuurmansfrom typing import Any, Dictfrom asgiref.sync import sync_to_asyncfrom fluent.sender import FluentSenderfrom .gateway import GatewayJson = Dict[str, Any]class FluentbitGateway(Gateway):    def __init__(self, tag: str, host: str, port: int):        self._sender = FluentSender(tag, host=host, port=port)    @sync_to_async    def add(self, item: Json) -> Json:        self._sender.emit(item.pop("tag_suffix", ""), item)        return item
 |