from typing import Awaitable, Callable, Protocol


class MqttClientProtocol(Protocol):

    async def subscribe(
        self,
        topic: str,
        callback: Callable[[str, bytes], Awaitable[None]],
    ) -> None:
        ...

    async def publish(
        self,
        topic: str,
        payload: bytes,
        qos: int = 0,
        retain: bool = False,
    ) -> None:
        ...

    async def runForever(self) -> None:
        ...
