Dispatch a work.

@param Work  $work
@param array $data
976549
public function execute(Work $work, stdClass $payload, array $data = [])
    {
        $generator = $this->manager->getRepository()->findOneById($payload->data->id);

        $result = $this->manager->generate($generator, $data);
    }
137612
public function push($job, $data = '', $queue = null)
    {
        $this->lastPushed = $job;

        return parent::push($job, $data, $queue);
    }
1187014
public function setTask(AbstractWorker $worker, $data): void
    {
        $key = sprintf('worker:%s', $worker->getId());

        $this->client->set($key, json_encode($data));
    }
105544
protected function dispatchInsert($item, $eventData = array()) {
    return $this->manager->dispatchEvent(self::EVENT_INSERT, array_merge(array('item'=>$item), $eventData), $this);
  }
535657
public function dispatch(array $events)
    {
        foreach ($events as $event) {
            $eventName = $this->getEventName($event);

            $this->app->fireEvent($eventName, $event);
            $this->app->logEvent($eventName .' was fired.');
        }
    }
968862
public function dispatch($eventName, $data, array $expectedReactions)
    {
        $event = new Event($this->dispatcher);

        return $event->name($eventName)->with($data)->expect($expectedReactions)->getReaction();
    }
83181
public function dispatch(): void
    {
        $dispatcher = new Dispatcher();

        if ($this->connector) {
            $dispatcher->add($this->listenConnector());
        }

        if ($this->exchangeWorkersData) {
            $dispatcher->add($this->listenWorkers());
        }

        $dispatcher->dispatch();
    }
490601
protected function handleDispatch($data)
    {
        if (! is_null($hData = $this->handlers->getHandler($data->t))) {
            $handler = new $hData['class'](
                $this->http,
                $this->factory,
                $this->cache,
                $this
            );

            $deferred = new Deferred();
            $deferred->promise()->then(function ($d) use ($data, $hData) {
                if (is_array($d) && count($d) == 2) {
                    list($new, $old) = $d;
                } else {
                    $new = $d;
                    $old = null;
                }

                $this->emit($data->t, [$new, $this, $old]);

                foreach ($hData['alternatives'] as $alternative) {
                    $this->emit($alternative, [$d, $this]);
                }

                if ($data->t == Event::MESSAGE_CREATE && mentioned($this->client->user, $new)) {
                    $this->emit('mention', [$new, $this, $old]);
                }
            }, function ($e) use ($data) {
                $this->logger->warning('error while trying to handle dispatch packet', ['packet' => $data->t, 'error' => $e]);
            }, function ($d) use ($data) {
                $this->logger->warning('notified from event', ['data' => $d, 'packet' => $data->t]);
            });

            $parse = [
                Event::GUILD_CREATE,
            ];

            if (! $this->emittedReady && (array_search($data->t, $parse) === false)) {
                $this->unparsedPackets[] = function () use (&$handler, &$deferred, &$data) {
                    $handler->handle($deferred, $data->d);
                };
            } else {
                $handler->handle($deferred, $data->d);
            }
        }

        $handlers = [
            Event::VOICE_SERVER_UPDATE => 'handleVoiceServerUpdate',
            Event::RESUMED             => 'handleResume',
            Event::READY               => 'handleReady',
            Event::GUILD_MEMBERS_CHUNK => 'handleGuildMembersChunk',
            Event::VOICE_STATE_UPDATE  => 'handleVoiceStateUpdate',
        ];

        if (isset($handlers[$data->t])) {
            $this->{$handlers[$data->t]}($data);
        }
    }
889610
protected function work(): void
    {
        if (@$this->worker->work()
            || $this->worker->returnCode() == GEARMAN_IO_WAIT
            || $this->worker->returnCode() == GEARMAN_NO_JOBS
        ) {
            if ($this->worker->returnCode() == GEARMAN_SUCCESS) {
                return;
            }

            if (!@$this->worker->wait()) {
                if ($this->worker->returnCode() == GEARMAN_NO_ACTIVE_FDS) {
                    sleep(5);
                }
            }
        }
    }
199877
public function my_dispatchEvent($type, $data)
    {
        foreach ($this->client as $client) {
            $client->dispatchEvent($type, $data);
        }
    }
436903
public function import(array $data)
    {
        $this->_params = $this->arrayUtil->merge($this->_params, $data);
    }
543311
public function handle(NodeInterface $node, array $data)
    {
        if ($node->getNodeType()->isOfType('Neos.Neos:Document')) {
            if (isset($data['title'])) {
                $node->setProperty('title', $data['title']);
            }
            $node->setProperty('uriPathSegment', $this->nodeUriPathSegmentGenerator->generateUriPathSegment($node, (isset($data['title']) ? $data['title'] : null)));
        }
    }
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();
		}
	}
}
210716
public function updateData(array $data) {
        foreach($data as $name => $value) {
            $this->data[$name] = $value;
        }
    }
385594
public function handle( $data )
    {
        $this->data = $data;

        if ( $message = $this->createMessage() )
        {
            $this->getMailer()->send( $message );
        }
    }
341443
public function finishedWorking(AbstractWorker $worker): void
    {
        $this->adapter->increaseProcessedCount();
        $this->adapter->increaseWorkerProcessedCount($worker);
        $this->adapter->clearTaskData($worker);
    }
728606
public function write($data)
	{
		$this->createFolderIfNotExist($this->folderPath());
		$this->createFile($this->getFilePath(), $data);
	}