# Path: muranoagent/common/messaging/message.py
# LOG = logging.getLogger("murano-common.messaging")
# class Message(object):
#     def __init__(self, connection=None, message_handle=None):
#     def body(self):
#     def body(self, value):
#     def id(self):
#     def id(self, value):
#     def reply_to(self):
#     def ack(self):
#     def signature(self):


import collections
import socket
import time
import kombu
from muranoagent.common.messaging import message
        self._consumer.consume()
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        if self._consumer is not None and not exc_type:
            self._consumer.cancel()
        return False

    def get_message(self, timeout=None):
        self._check_exception()
        msg_handle = self._get(timeout=timeout)
        if msg_handle is None:
            return None
        return message.Message(self._connection, msg_handle)

    def _get(self, timeout=None):
        self._check_exception()
        elapsed = 0.0
        remaining = timeout
        while True:
            time_start = time.time()
            if self._buffer:
                return self._buffer.pop()
            try:
                self._connection.drain_events(timeout=timeout and remaining)
            except socket.timeout:
                return None
            elapsed += time.time() - time_start
            remaining = timeout and timeout - elapsed or None


# Path: muranoagent/common/messaging/message.py
# LOG = logging.getLogger("murano-common.messaging")
# class Message(object):
#     def __init__(self, connection=None, message_handle=None):
#     def body(self):
#     def body(self, value):
#     def id(self):
#     def id(self, value):
#     def reply_to(self):
#     def ack(self):
#     def signature(self):


# Path: muranoagent/common/messaging/subscription.py
import collections
import socket
import time
import kombu
from muranoagent.common.messaging import message

        self._consumer.consume()
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        if self._consumer is not None and not exc_type:
            self._consumer.cancel()
        return False

    def get_message(self, timeout=None):
        self._check_exception()
        msg_handle = self._get(timeout=timeout)
        if msg_handle is None:
            return None
        return message.Message(self._connection, msg_handle)

    def _get(self, timeout=None):
        self._check_exception()
        elapsed = 0.0
        remaining = timeout
        while True:
            time_start = time.time()
            if self._buffer:
                return self._buffer.pop()
            try:
                self._connection.drain_events(timeout=timeout and remaining)
            except socket.timeout:
                return None
            elapsed += time.time() - time_start
            remaining = timeout and timeout - elapsed or None


    def _receive(self, message_data, message):