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