Emit everything available so far in the queue
438882
function emitData() {
      for(var i=0;i<streamQueue.length;i++) {
        var dataQueue = streamQueue[i].dataQueue;

        if(streamQueue[i].pending) {
          return;
        }

        for(var j=0;j<dataQueue.length;j++) {
          var data = dataQueue[j];
          if(!!data) {
            _this.emit('data', data);
            dataQueue[j] = null;

            return emitData();
          }
        }
      }

      if(currentStream === streamQueue.length) {
        _this.emit('end');
      }
    }
1137011
def _list_items(queue):
    '''
    
    '''
    con = _conn(queue)
    with con:
        cur = con.cursor()
        cmd = 'SELECT name FROM {0}'.format(queue)
        log.debug('SQL Query: %s', cmd)
        cur.execute(cmd)
        contents = cur.fetchall()
    return contents
1089462
def emit(self, *args, **kwargs):
        '''
        
        '''
        self._messanger.send(self, *args, **kwargs)
545699
def queue(self, *args, **kwargs):
        
        self.scraper.task_manager.put(self, args, kwargs)
        return self
1108311
def emit(self, record):
        """"""
        self.entries.append(self.format(record))
        if len(self.entries) > self.flush_limit and not self.session.auth.renewing:
            self.log_to_api()
            self.entries = []
348100
def work():
    """"""
    with rq.Connection(create_connection()):
        worker = rq.Worker(list(map(rq.Queue, listen)))
        worker.work()
1065265
async def emit(self, event, data, namespace, room=None, skip_sid=None,
                   callback=None, **kwargs):
        
        if namespace not in self.rooms or room not in self.rooms[namespace]:
            return
        tasks = []
        for sid in self.get_participants(namespace, room):
            if sid != skip_sid:
                if callback is not None:
                    id = self._generate_ack_id(sid, namespace, callback)
                else:
                    id = None
                tasks.append(self.server._emit_internal(sid, event, data,
                                                        namespace, id))
        if tasks == []:  # pragma: no cover
            return
        await asyncio.wait(tasks)
563411
def _emit_message(cls, message):
        """"""
        sys.stdout.write(message)
        sys.stdout.flush()
618226
function queue(context, file, fileSet, next) {
  var origin = file.history[0]
  var map = fileSet.complete
  var complete = true

  if (!map) {
    map = {}
    fileSet.complete = map
  }

  debug('Queueing `%s`', origin)

  map[origin] = next

  fileSet.valueOf().forEach(each)

  if (!complete) {
    debug('Not flushing: some files cannot be flushed')
    return
  }

  fileSet.complete = {}

  fileSet.pipeline.run(fileSet, done)

  function each(file) {
    var key = file.history[0]

    if (stats(file).fatal) {
      return
    }

    if (typeof map[key] === 'function') {
      debug('`%s` can be flushed', key)
    } else {
      debug('Interupting flush: `%s` is not finished', key)
      complete = false
    }
  }

  function done(error) {
    debug('Flushing: all files can be flushed')

    /* Flush. */
    for (origin in map) {
      map[origin](error)
    }
  }
}
267312
def all_jobs(self):
        
        return list(set(self.complete + self.failed + self.queue + self.running))
624202
def _push_next(self):
        """"""
        r = next(self._iter, None)
        if r is None:
            return
        self._key_queue.put((self._sent_idx, r))
        self._sent_idx += 1
214207
def emit(self, event, data=None, room=None, include_self=True,
             namespace=None, callback=None):
        """"""
        return self.socketio.emit(event, data, room=room,
                                  include_self=include_self,
                                  namespace=namespace or self.namespace,
                                  callback=callback)
1229251
function queue ({
  load,
  retry = 0

}) {

  const emitter = new EventEmitter()
  emitter.setMaxListeners(0)

  const results = {}

  function add (param = '', callback) {
    let key

    if (arguments.length === 1) {
      callback = param
      key = ''

    } else {
      key = JSON.stringify(param)
    }

    if (key in results) {
      return callback(...results[key])
    }

    emitter.on(key, callback)

    if (emitter.listenerCount(key) === 1) {
      loadResource(param, load, retry)
      .then((data) => {
        results[key] = [null, data]
        emitter.emit(key, null, data)
        emitter.removeAllListeners(key)
      })
      .catch((err) => {
        emitter.emit(key, err)
        // again
        emitter.removeAllListeners(key)
      })
    }
  }

  return {
    // expose cache so that we could handle it
    cache: results,
    add: (param) => {
      return new Promise((resolve, reject) => {
        add(param, (err, data) => {
          if (err) {
            return reject(err)
          }

          resolve(data)
        })
      })
    }
  }
}
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));
            }

        }

    }
401385
def emit(self):
        """"""

        self.count += 1

        # event_name = 'on_{0}'.format(self.context.subcategory.lower())
        event_name = self.context.subcategory
        if hasattr(self.handler, event_name):
            getattr(self.handler, event_name)(self.context)
        elif hasattr(self.handler, 'default'):
            self.handler.default(self.context)
410294
function runQueue(){
			if( urllist.length ){
				AI.makeReq( o.proxy + urllist.join( "," ), elQueue );
				elQueue = $();
				urllist = [];
			}
		}
876736
def putnotify(self, name, *args):
        """"""
        # self.signals[name][0].send(*args)
        self.queues[name][0].put(*args)
        self.queues[name][1].set()