def on_message_received(self, msg):
        """Append a message to the buffer.

        :raises: BufferError
            if the reader has already been stopped
        """
        if self.is_stopped:
            raise RuntimeError("reader has already been stopped")
        else:
            self.buffer.put(msg)
def on_message_received ( self , msg ) : if self . is_stopped : raise RuntimeError ( "reader has already been stopped" ) else : self . buffer . put ( msg )
Append a message to the buffer.

        :raises: BufferError
            if the reader has already been stopped