push a dummy job in queue to force activation
769202
function JobQueueActivate(queue, callback, timeout) {
        setTimeout(function () {queue.push (null, callback);}, timeout); // wait 5S before start
    }
134975
public void push(CollectorRegistry registry, String job) throws IOException {
    doRequest(registry, job, null, "PUT");
  }
44581
def extra_prepare_after_activation(self, configuration, args_dict):
        """"""
        aws_syncr = configuration['aws_syncr']
        configuration["amazon"] = Amazon(configuration['aws_syncr'].environment, configuration['accounts'], debug=aws_syncr.debug, dry_run=aws_syncr.dry_run)
1218230
public function pushQueue()
    {
        $delay = $this->schedule_timestamp - time();

        if ($delay < 1) {
            $delay = 0;
        }

        Yii::$app->adminqueue->delay($delay)->push(new ScheduleJob(['schedulerId' => $this->id]));
    }
1083636
def move(self, queue, delay=0, depends=None):
        ''''''
        logger.info('Moving %s to %s from %s',
            self.jid, queue, self.queue_name)
        return self.client('put', self.worker_name,
            queue, self.jid, self.klass_name,
            json.dumps(self.data), delay, 'depends', json.dumps(depends or [])
        )
852700
def idempotent_job_enqueue(job_name, time, config)
      registered = SidekiqScheduler::RedisManager.register_job_instance(job_name, time)

      if registered
        Sidekiq.logger.info "queueing #{config['class']} (#{job_name})"

        handle_errors { enqueue_job(config, time) }

        SidekiqScheduler::RedisManager.remove_elder_job_instances(job_name)
      else
        Sidekiq.logger.debug { "Ignoring #{job_name} job as it has been already enqueued" }
      end
    end
1289353
def enqueue_job(self, job):
        
        self.log.debug('Pushing {0} to {1}'.format(job.id, job.origin))

        interval = job.meta.get('interval', None)
        repeat = job.meta.get('repeat', None)
        cron_string = job.meta.get('cron_string', None)

        # If job is a repeated job, decrement counter
        if repeat:
            job.meta['repeat'] = int(repeat) - 1

        queue = self.get_queue_for_job(job)
        queue.enqueue_job(job)
        self.connection.zrem(self.scheduled_jobs_key, job.id)

        if interval:
            # If this is a repeat job and counter has reached 0, don't repeat
            if repeat is not None:
                if job.meta['repeat'] == 0:
                    return
            self.connection.zadd(self.scheduled_jobs_key,
                                  {job.id: to_unix(datetime.utcnow()) + int(interval)})
        elif cron_string:
            # If this is a repeat job and counter has reached 0, don't repeat
            if repeat is not None:
                if job.meta['repeat'] == 0:
                    return
            self.connection.zadd(self.scheduled_jobs_key,
                                  {job.id: to_unix(get_next_scheduled_time(cron_string))})
551182
public void enqueue(final Activation element) {
        if ( isFull() ) {
            grow();
        }

        percolateUpMaxHeap( element );
        element.setQueued(true);

        if ( log.isTraceEnabled() ) {
            log.trace( "Queue Added {} {}", element.getQueueIndex(), element);
        }
    }
879719
function () {
		if (item.done === false) {
			LOG.error('job timeout! please check if the job calls onDone eventually. ' + (item.name ? '[' + item.name + ']' : ''), l_name);
			
			// force this job be done
			onJobDone(false);
		}
	}
366760
def force_close(self) -> None:
        """"""
        self._force_close = True
        if self._waiter:
            self._waiter.cancel()
        if self.transport is not None:
            self.transport.close()
            self.transport = None
71246
function _go() {
        if(workers < concurrency) {
            var job = queue.shift();
            if(job !== undefined) {
                var worker = job.shift();
                job.push(over);
                workers++;
                process.nextTick(function nextTickWorker() {
                    worker.apply(null, job);
                });
                return true;
            }
        }
        return false;
    }
740909
public function push(Job $job, $queueName = '')
    {
        if (!isset($this->queues[$queueName])) {
            $this->queues[$queueName] = [];
        }

        $this->queues[$queueName][] = $job;

        return Queue::QUEUED;

    }
1241389
@Override
    public final Job queueIn(final Job job, final long millis) {
        return pushAt(job, System.currentTimeMillis() + millis);
    }
1045187
def _push_actions(self):
        
        data = cherrypy.request.json
        with self.app.lock:
            self.app.add_actions(data['actions'], data['scheduler_instance_id'])
924619
def submit(self, new_queue = None):
    """"""
    self.status = 'submitted'
    self.result = None
    self.machine_name = None
    if new_queue is not None:
      self.queue_name = new_queue
    for array_job in self.array:
      array_job.status = 'submitted'
      array_job.result = None
      array_job.machine_name = None
    self.submit_time = datetime.now()
    self.start_time = None
    self.finish_time = None
133543
def push(self):
        """"""
        self._refresh_connection()

        # Check if we need to update mappings as this needs to be done
        # before we push anything to the Elasticsearch server.
        # This must be done even if the queue is empty, as otherwise ES
        # will fail when retrieving data.
        if not self._mapping_created:
            logger.debug("Pushing mapping for Elasticsearch index '%s'.", self.__class__.__name__)
            self.create_mapping()

        if not self.push_queue:
            logger.debug("No documents to push, skipping push.")
            return

        logger.debug("Found %s documents to push to Elasticsearch.", len(self.push_queue))

        bulk(connections.get_connection(), (doc.to_dict(True) for doc in self.push_queue), refresh=True)
        self.push_queue = []

        logger.debug("Finished pushing builded documents to Elasticsearch server.")
1117358
def run(self, once=False, force_once=False):
        

        self.log.info('ready', id=self.id,
                               queues=sorted(self.only_queues),
                               exclude_queues=sorted(self.exclude_queues),
                               single_worker_queues=sorted(self.single_worker_queues),
                               max_workers=self.max_workers_per_queue)

        if not self.scripts.can_replicate_commands:
            # Older Redis versions may create additional overhead when
            # executing pipelines.
            self.log.warn('using old Redis version')

        if self.config['STATS_INTERVAL']:
            self.stats_thread = StatsThread(self)
            self.stats_thread.start()

        # Queue any periodic tasks that are not queued yet.
        self._queue_periodic_tasks()

        # First scan all the available queues for new items until they're empty.
        # Then, listen to the activity channel.
        # XXX: This can get inefficient when having lots of queues.

        self._pubsub = self.connection.pubsub()
        self._pubsub.subscribe(self._key('activity'))

        self._queue_set = set(self._filter_queues(
                self.connection.smembers(self._key(QUEUED))))

        try:
            while True:
                # Update the queue set on every iteration so we don't get stuck
                # on processing a specific queue.
                self._wait_for_new_tasks(timeout=self.config['SELECT_TIMEOUT'],
                            batch_timeout=self.config['SELECT_BATCH_TIMEOUT'])

                self._install_signal_handlers()
                self._did_work = False
                self._worker_run()
                self._uninstall_signal_handlers()
                if once and (not self._queue_set or force_once):
                    break
                if self._stop_requested:
                    raise KeyboardInterrupt()
        except KeyboardInterrupt:
            pass

        except Exception as e:
            self.log.exception(event='exception')
            raise

        finally:
            if self.stats_thread:
                self.stats_thread.stop()
                self.stats_thread = None

            # Free up Redis connection
            self._pubsub.reset()
            self.log.info('done')