Dispatch work items on free workers
969081
function dispatchWorkItems() {
	var i,
		workItem;
	if (!buffer.isEmpty()) {
		i = workerJobCount.indexOf(0);
		if(i >= 0) { //Free worker found
			workItem = buffer.next();

			// Send task to worker
			workerExec(i, workItem);

			//Check for more free workers
			dispatchWorkItems();
		}
	}
}
1158572
def _dispatch(self, textgroup, directory):
        
        self.dispatcher.dispatch(textgroup, path=directory)
827382
private void handleFreeSlot(TaskManagerSlot freeSlot) {
		Preconditions.checkState(freeSlot.getState() == TaskManagerSlot.State.FREE);

		PendingSlotRequest pendingSlotRequest = findMatchingRequest(freeSlot.getResourceProfile());

		if (null != pendingSlotRequest) {
			allocateSlot(freeSlot, pendingSlotRequest);
		} else {
			freeSlots.put(freeSlot.getSlotId(), freeSlot);
		}
	}
978817
def dispatch(self):
        
        from flask import request

        method = request.method

        data = request.args
        if method == 'POST':
            data = request.form

        token = data.get('token')
        team_id = data.get('team_id')
        command = data.get('command') or data.get('trigger_word')

        if isinstance(command, string_types):
            command = command.strip().lstrip('/')

        try:
            self.validate(command, token, team_id, method)
        except SlackError as e:
            return self.response(e.msg)

        func, _, _, kwargs = self._commands[(team_id, command)]
        kwargs.update(data.to_dict())

        return func(**kwargs)
775780
def dispatch(channel, message)
      # Dispatch the task in the worker pool.  Pas in the meta data
      @worker_pool.post do
        begin
          dispatch_in_thread(channel, message)
        rescue => e
          err = "Worker Thread Exception for #{message}\n"
          err += e.inspect
          err += e.backtrace.join("\n") if e.respond_to?(:backtrace)

          Volt.logger.error(err)
        end
      end
    end
345815
def dispatch(self, *args, **kwargs):
        """"""
        return super(AnimalMonthArchive, self).dispatch(*args, **kwargs)
598864
function startWorkers() {
        _.range(0, numWorkers).forEach(function (index) {
            workers.push(startWorker(startPort + index));
        });
    }
1233415
function dispatch(action, payload) {
    if (process.env.NODE_ENV !== 'production' && dispatching) {
      throw new Error(`'${action.toString()}' was dispatched while '${dispatching.toString()}' was still updating. Updaters should be pure functions and must not dispatch actions.`);
    }
    try {
      dispatching = action;
      state = updater(state, action, payload);
      if (process.env.NODE_ENV !== 'production' && debug) {
        console.info(state);
      }
    } finally {
      dispatching = null;
    }
    updateUI();
  }
778520
def _work(self):
        """"""
        server = wsgi.Server(
            name=self._AGENT_BINARY,
            num_threads=CONF.AGENT.worker_count)
        server.start(
            application=_MetadataProxyHandler(),
            port=CONF.bind_port,
            host=CONF.bind_host)
        server.wait()
266872
def _dismiss_worker(self, worker):
        """"""
        self._workers.remove(worker)
        if len(self._workers) < self._min_workers:
            self._workers.add(worker)
            return False
        return True
710389
def dispatch_hook(key, hooks, hook_data, **kwargs):
    """"""
    hooks = hooks or {}
    hooks = hooks.get(key)
    if hooks:
        if hasattr(hooks, '__call__'):
            hooks = [hooks]
        for hook in hooks:
            _hook_data = hook(hook_data, **kwargs)
            if _hook_data is not None:
                hook_data = _hook_data
    return hook_data
757289
function WorkerJob(msg, options, callback) {
  this.msg = msg || {};
  this.options = options || {};
  this.callback = callback;
}
1227992
function() {
        var args = [].slice.call(arguments, 0);
        var workerMessage, done = 0;
        var workerKeys = Object.keys(cluster.workers);
        var nextWorker = function() {
          if (workerKeys.length) {
            done++;
            cluster.workers[workerKeys.shift()].send(taskMessage.concat([args]));
          } else {
            app.log("Executed [%s] on %d workers", id, done);
            app.removeListener('worker_message', workerMessage);
          }
        }
        app.on('worker_message', workerMessage = function(msg) {
          if (isMessageForMe(msg) && msg[3] === 'done') {
            nextWorker()
          }
        });
        nextWorker();
      }
482970
def dispatch(self, *args, **kwargs):
        """"""
        action = kwargs.pop('action', 'default')
        action_method = getattr(self, str(action), self.default)
        return action_method(*args, **kwargs)
850644
def dispatch(self, category, func, *args):
        """"""
        self.factory.loader.runPlugins(category, func, self, *args)
284995
def _clean(self):
        """"""
        if self._workers:
            for url in self._workers.copy():
                w = self._workers[url]
                if w.is_finished():
                    self._workers.pop(url)
                    self._paths.pop(url)
                    if url in self._get_requests:
                        self._get_requests.pop(url)

        else:
            self._timer.stop()
549768
public function dispatch()
    {
        $this->lock->acquire();

        $this->guardThatHistoryRepositoryDoesNotHaveMoreUnitsOfWork();

        $workloadRepository = $this->sourceRepository->diff(
            $this->historyRepository
        );

        foreach ($workloadRepository as $unitOfWork) {
            $this->executeMigration($unitOfWork);
        }

        $this->historyRepository->persist();

        $this->lock->release();
    }