emit and remove the first emission in the queue
320936
def send_emission(self):
        
        if self._emit_queue.empty():
            return
        emit = self._emit_queue.get()
        emit()
1349749
function _removeIdlePromise(idleQueue, promise) {
    if (!promise) return;

    // remove timeout if exists
    if (promise._timeoutObj)
        clearTimeout(promise._timeoutObj);

    // remove handle-nr if exists
    if (idleQueue._pHM.has(promise)) {
        const handle = idleQueue._pHM.get(promise);
        idleQueue._hPM.delete(handle);
        idleQueue._pHM.delete(promise);
    }

    // remove from queue
    idleQueue._iC.delete(promise);
}
1202888
def Flush(self):
    """"""
    self._CheckLeaseAndFlush()
    self.Load()
    super(FlowBase, self).Flush()
    # Writing the messages queued in the queue_manager of the runner always has
    # to be the last thing that happens or we will have a race condition.
    self.FlushMessages()
117510
def run(self):
        ''''''
        # We left-append rather than emit (right-append) because some message
        # may have been already queued for execution before the director runs.
        global_event_queue.appendleft((INITIATE, self, (), {}))
        while global_event_queue:
            self.process_event(global_event_queue.popleft())
341324
def flush(self, queue_name):
        
        for name in (queue_name, dq_name(queue_name), xq_name(queue_name)):
            self.channel.queue_purge(name)
847629
function purgeADQueue (channel, connectionName, options, messages) {
  const name = options.uniqueName || options.name;
  return new Promise(function (resolve, reject) {
    const messageCount = messages.messages.length;
    if (messageCount > 0) {
      log.info(`Purge operation for queue '${options.name}' on '${connectionName}' is waiting for resolution on ${messageCount} messages`);
      messages.once('empty', function () {
        channel.purgeQueue(name)
          .then(
            result => resolve(result.messageCount),
            reject
          );
      });
    } else {
      channel.purgeQueue(name)
        .then(
          result => resolve(result.messageCount),
          reject
        );
    }
  });
}
834807
def flush(self):
        
        for elem in self:
            if elem.id[0] != scoop.worker:
                elem._delete()
            self.socket.sendFuture(elem)
        self.ready.clear()
        self.movable.clear()
905617
def unqueue_and_display(self, filename):
        """"""
        if self.running and self.ws:
            self.editor.lazy_display_error(filename)
            self.unqueue()
989798
public void dequeueIfNotDoneYet(Element elem, String name, Object object) {
    @SuppressWarnings("rawtypes")
    Queue queue = queue(elem, name, null);
    if (queue != null && object.equals(queue.peek())) {
      dequeueCurrentAndRunNext(elem, name);
    }
  }
785047
def clear(self):
    """"""
    while self.current or self.idlers or self.queue or self.rpcs:
      current = self.current
      idlers = self.idlers
      queue = self.queue
      rpcs = self.rpcs
      _logging_debug('Clearing stale EventLoop instance...')
      if current:
        _logging_debug('  current = %s', current)
      if idlers:
        _logging_debug('  idlers = %s', idlers)
      if queue:
        _logging_debug('  queue = %s', queue)
      if rpcs:
        _logging_debug('  rpcs = %s', rpcs)
      self.__init__()
      current.clear()
      idlers.clear()
      queue[:] = []
      rpcs.clear()
      _logging_debug('Cleared')
96131
async def clear_queue(self):
        """"""
        conn = await self._make_connection()
        try:
            script = """
                local keys = redis.call('KEYS', ARGV[1])
                redis.call('DEL', unpack(keys))
            """
            await conn.eval(
                script,
                keys=[],
                args=['*{}*'.format(settings.FLOW_MANAGER['REDIS_PREFIX'])],
            )
        finally:
            conn.close()
1042510
def queue_purge(self, queue, **kwargs):
        """"""
        return self.channel.queue_purge(queue=queue).message_count
1266793
function emit() {
  var self = this;
  (function execute() {
    try {
      if(self.i >= self.length) {
        self.emit('end');
      }
      else {
        var k = self.keys[self.i];
        self.emit('data', self.arr[k], k); 
        self.i++;
        if (!self.paused) nextTick(execute);
      }
    } catch (e) {
      self.emit('error', e);
      if (self._options.tolerant) {
        self.i++;
        if (!self.paused) nextTick(execute);
      }
      else {
        self.emit('end');
        self.readable = false;
      }
    }
  })();
}
12061
private static void purgeQueue() {

        ChronoReference cref;

        while ((cref = (ChronoReference) QUEUE.poll()) != null) {
            for (ChronoReference test : CHRONOS) {
                if (test.name.equals(cref.name)) {
                    CHRONOS.remove(test);
                    break;
                }
            }
        }

    }
977444
def RemoveFromQueue(self, addr):
        
        if addr in self.connection_queue:
            self.connection_queue.remove(addr)
48039
def halt(self, message, emitter, *args, **kwargs):
        ''''''
        self.process_event((FINISH, self, (), {}))
        global_event_queue.clear()
405771
function (end, clearQueue, queue) {
            var self = this;
            util.each(self, function (elem) {
                Anim.stop(elem, end, clearQueue, queue);
            });
            return self;
        }