from abc import ABCMeta, abstractmethod
from typing import (
    Any,
    Optional,
)

from ._Message import Message


class LowLevelMessageBus(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def send_direct_message(self, address, message):
        # type: (Any, Message) -> Message
        raise NotImplementedError()

    @abstractmethod
    def reply_message(self, message, reply_message):
        # type: (Message, Message) -> None
        raise NotImplementedError()

    @abstractmethod
    def receive(self, timeout=None):
        # type: (Optional[int]) -> Message
        raise NotImplementedError()
