Enqueue a message to be sent, and notify main loop
334310
def enqueue(self, queue_identifier: QueueIdentifier, message: Message):
        
        assert queue_identifier.recipient == self.receiver
        with self._lock:
            already_queued = any(
                queue_identifier == data.queue_identifier and message == data.message
                for data in self._message_queue
            )
            if already_queued:
                self.log.warning(
                    'Message already in queue - ignoring',
                    receiver=pex(self.receiver),
                    queue=queue_identifier,
                    message=message,
                )
                return
            timeout_generator = udp_utils.timeout_exponential_backoff(
                self.transport._config['retries_before_backoff'],
                self.transport._config['retry_interval'],
                self.transport._config['retry_interval'] * 10,
            )
            expiration_generator = self._expiration_generator(timeout_generator)
            self._message_queue.append(_RetryQueue._MessageData(
                queue_identifier=queue_identifier,
                message=message,
                text=json.dumps(message.to_dict()),
                expiration_generator=expiration_generator,
            ))
        self.notify()
352336
def wait_send(self, timeout = None):
		""""""
		self._send_queue_cleared.clear()
		self._send_queue_cleared.wait(timeout = timeout)
967662
def _on_receive(self, msg):
        
        _vv and IOLOG.debug('%r._on_receive(%r)', self, msg)
        self._latch.put(msg)
        if self.notify:
            self.notify(self)
481619
function(msg) {
        if (onSendLogging)
          asyncLogger("Send", msg);

        switch (protocol) {
          case 'websocket':
            if (socketState === socketStateType.OPEN) {
              socket.emit(msg);
            } else {
              pushSendDataQueue.push(msg);
            }
            break;

          case 'queue':
            if (socketState === socketStateType.OPEN) {
              activemq.sendMessage({
                destination: params.queueSend,
                message: msg
              });
            } else {
              pushSendDataQueue.push(msg);
            }
            break;
        }
      }
206813
def send_messages(self, messages):
        """"""
        if not messages:
            return
        self._lock.acquire()
        try:
            # The try-except is nested to allow for
            # Python 2.4 support (Refs #12147)
            try:
                stream_created = self.open()
                for message in messages:
                    self.stream.write(render_message(message))
                    self.stream.write('\n')
                    self.stream.write('-'*79)
                    self.stream.write('\n')
                    self.stream.flush()  # flush after each message
                if stream_created:
                    self.close()
            except:
                if not self.fail_silently:
                    raise
        finally:
            self._lock.release()
        return len(messages)
338740
def NotifyQueue(self, notification, **kwargs):
    """"""
    self._MultiNotifyQueue(notification.session_id.Queue(), [notification],
                           **kwargs)
1277481
function enqueue(count) {
      while (count--) {
        queue.push(bench.clone({
          '_original': bench,
          'events': {
            'abort': [update],
            'cycle': [update],
            'error': [update],
            'start': [update]
          }
        }));
      }
    }
202467
def process_messages_loop_internal(self):
        
        while self.receiving_messages:
            # connect to AMQP server and listen for 1 message then disconnect
            self.work_request = None
            self.connection.receive_loop_with_callback(self.queue_name, self.save_work_request_and_close)
            if self.work_request:
                self.process_work_request()
46464
def enqueue_global(self, message: Message):
        
        self.enqueue(
            queue_identifier=QueueIdentifier(
                recipient=self.receiver,
                channel_identifier=CHANNEL_IDENTIFIER_GLOBAL_QUEUE,
            ),
            message=message,
        )
320318
async def send_notification(self, method, args=()):
        ''''''
        message = self.connection.send_notification(Notification(method, args))
        await self._send_message(message)
909220
def send(self, message, callback=None):
        """"""
        assert isinstance(message, velbus.Message)
        self._write_queue.put_nowait((message, callback))
834596
def send(self, msg):
        """"""
        debug('sent %s', msg)
        self.loop.send(self._packer.pack(msg))
1099968
def process_messages_loop_internal(self):
        
        logging.info("Starting work queue loop.")
        self.connection.receive_loop_with_callback(self.queue_name, self.process_message)
845966
def notifyPop(self, queue, length = 1):
        '''
        
        '''
        self.totalSize = self.totalSize - length
        ret1 = []
        ret2 = []
        if self.isWaited and self.canAppend():
            self.isWaited = False
            ret1.append(QueueCanWriteEvent(self))
        if self.isWaitEmpty and not self:
            self.isWaitEmpty = False
            ret2.append(QueueIsEmptyEvent(self))
        if self.parent is not None:
            pr = self.parent.notifyPop(self, length)
            ret1 += pr[0]
            ret2 += pr[1]
        newblocked =  not self.canPop()
        if newblocked != self.blocked:
            self.blocked = newblocked
            if self.parent is not None:
                self.parent.notifyBlock(self, newblocked)
        return (ret1, ret2)
1049371
private void sendQueuedInvocations() {
        while (true) {
            MethodInvocation<?> currentRPC = queuedRpcList.poll();
            if (currentRPC == null) {
                return;
            }

            try {
                connector.executeAsyncMethod(currentRPC.getProxy(),
                                             currentRPC.getMethod(),
                                             currentRPC.getArgs(),
                                             currentRPC.getFuture());
            } catch (JoynrRuntimeException e) {
                currentRPC.getFuture().onFailure(e);
            } catch (Exception e) {
                currentRPC.getFuture().onFailure(new JoynrRuntimeException(e));
            }

        }

    }
565843
public void enqueue(SerialMessage serialMessage) {
		this.sendQueue.add(serialMessage);
		logger.debug("Enqueueing message. Queue length = {}", this.sendQueue.size());
	}
1248806
async def _notify(self, message: BaseMessage, responder: Responder):
        
        for cb in self._listeners:
            coro = cb(message, responder, self.fsm_creates_task)

            if not self.fsm_creates_task:
                self._register = await coro