# Path: chirp/stream/looper.py
# class Looper(object):
#     MAX_TRAPPED_EXCEPTIONS = 100
#     def __init__(self):
#     def _begin_looping(self):
#     def _loop_once(self):
#     def _done_looping(self):
#     def _trap_exceptions(self, callable_to_wrap):
#     def loop(self):
#     def stop(self):
#     def loop_in_thread(self):
#     def wait(self):
#     def wait_until_looped_once(self):


import hashlib
import Queue
import time
from chirp.stream import looper
        """
        while not self._message_queue.empty():
            yield self._message_queue.get()

    def wait_until_empty(self):
        """Wait for all messages to be drained from the queue.

        Note that this is not thread-safe and not reliable.  For best
        results, only call this from the same thread that is adding
        messages to this MessageSource.  This should only be used in
        unit tests.
        """
        while not self._message_queue.empty():
            time.sleep(0.05)  # Wait for 50ms


class MessageConsumer(looper.Looper):
    """Base class for an object that consumes a stream of Message objects.

    The consumption of the messages is driven by a Looper.  The loop
    terminates when the stream ends.
    """

    def __init__(self, src):
        """Constructor.
        
        Args:
          src: A MessageSource object that will produce the stream of
            Messages for this object to consume.
        """

# Path: chirp/stream/looper.py
# class Looper(object):
#     MAX_TRAPPED_EXCEPTIONS = 100
#     def __init__(self):
#     def _begin_looping(self):
#     def _loop_once(self):
#     def _done_looping(self):
#     def _trap_exceptions(self, callable_to_wrap):
#     def loop(self):
#     def stop(self):
#     def loop_in_thread(self):
#     def wait(self):
#     def wait_until_looped_once(self):


# Path: chirp/stream/message.py
import hashlib
import Queue
import time
from chirp.stream import looper

        """
        while not self._message_queue.empty():
            yield self._message_queue.get()

    def wait_until_empty(self):
        """Wait for all messages to be drained from the queue.

        Note that this is not thread-safe and not reliable.  For best
        results, only call this from the same thread that is adding
        messages to this MessageSource.  This should only be used in
        unit tests.
        """
        while not self._message_queue.empty():
            time.sleep(0.05)  # Wait for 50ms


class MessageConsumer(looper.Looper):
    """Base class for an object that consumes a stream of Message objects.

    The consumption of the messages is driven by a Looper.  The loop
    terminates when the stream ends.
    """

    def __init__(self, src):
        """Constructor.
        
        Args:
          src: A MessageSource object that will produce the stream of
            Messages for this object to consume.
        """

        looper.Looper.__init__(self)