code: def next(self):
          
          # We pick the first outgoing available and send it.
          outgoing_msg = self.outgoing_msg_list.pop_first()
          # If we do not have any outgoing msg., we wait.
          if outgoing_msg is None:
              self.outgoing_msg_event.clear()
              self.outgoing_msg_event.wait()
              outgoing_msg = self.outgoing_msg_list.pop_first()
  
          return outgoing_msg
docs: Pops and returns the first outgoing message from the list.
  
          If message list currently has no messages, the calling thread will
          be put to sleep until we have at-least one message in the list that
          can be popped and returned.