Push an event batch to the Connect API.
@param array $batch the batch to push
@return Response
773113
private function pushEventBatch($batch) {
        $eventBatch = [];
        foreach ($batch as $collection => $events) {
            $eventBatch[$collection] = array_map(function ($eventDetails) {
                $event = new Event($eventDetails);
                return $event->getDetails();
            }, $events);
        }
        return $this->client->pushEventBatch($eventBatch);
    }
819869
protected static function collectUpdates($batchId)
    {
        return collect(static::$updatesQueue)
            ->each(function ($entry) use ($batchId) {
                $entry->change(['updated_batch_id' => $batchId]);
            });
    }
619857
def push_event(self, event_name, event_type, block_id):
        """"""
        self._db.rpush(event_name, dict(type=event_type, id=block_id))
1370939
protected function createQStrFromBatch(array &$batch) : string
    {
        $queryStr = '';
        foreach ($batch as & $t) {
            if (\count($t) > 1) {
                $queryStr .= 'BEGIN;' . implode(';', $t) . ';' . 'COMMIT;';
            }
        }

        unset($t);
        return $queryStr;
    }
391244
private function updateMigrationStatus($migration, $batch)
    {
        $table = $this->getMigrationTable();

        return $table->where('migration', $migration)->update([
            'migration' => $migration,
            'batch' => $batch
        ]);
    }
396854
public function replaceTextBatch(
        $batchId, Api\MtBatchTextSmsCreate $batch
    ) {
        $json = Serialize::textBatch($batch);
        $result = $this->_put($this->_batchUrl($batchId), $json);
        return Deserialize::batchResponse($result);
    }
1160144
public function send($method, $callback)
    {
        $payload = $method->toPayloadString();

        if (!$this->isBatch) {
            $proxy = function ($err, $res) use ($method, $callback) {
                if ($err !== null) {
                    return call_user_func($callback, $err, null);
                }
                if (!is_array($res)) {
                    $res = $method->transform([$res], $method->outputFormatters);
                    return call_user_func($callback, null, $res[0]);
                }
                $res = $method->transform($res, $method->outputFormatters);

                return call_user_func($callback, null, $res);
            };
            $this->requestManager->sendPayload($payload, $proxy);
        } else {
            $this->methods[] = $method;
            $this->batch[] = $payload;
        }
    }
418497
public function push(array $push = array()) {
        $query = array();
        if ( key_exists('query', $push) ) {
            $query = \CNCService\Core\CNCServiceArrayTrim($push, 'query');
            array_walk($query, function(&$v, $k, $path) {
                $v = $k . '=' . ($k == 'return' ? base64_encode($path) : $v);
            }, $this->_request->full_path);
        }
        $path = substr($this->_request->path, -1) == '/' ? 
                substr($this->_request->path, 0, strlen($this->_request->path) - 1) :
                $this->_request->path;
        return ($this->_config['root_dir'] ? '/' . $this->_config['root_dir'] : '') . '/' . $path . '/' . implode('/', $push) .
                ( $query ? '/?' . implode('&', $query) : '' );
    }
288448
public static function binaryBatchUpdate(Api\MtBatchBinarySmsUpdate $batch)
    {
        $fields = Serialize::_batchUpdateHelper($batch);

        $fields['type'] = 'mt_binary';

        if (null != $batch->getBody()) {
            $fields['body'] = base64_encode($batch->getBody());
        }

        if (null != $batch->getUdh()) {
            $fields['udh'] = bin2hex($batch->getUdh());
        }

        return Serialize::_toJson($fields);
    }
1350868
public function batch(string $operation)
    {
        $this->request->allowMethod(['post']);

        $table = $this->loadModel();
        Assert::isInstanceOf($table, Table::class);

        $redirectUrl = $this->getBatchRedirectUrl();

        $batchIds = (array)$this->request->getData('batch.ids');
        if (empty($batchIds)) {
            $this->Flash->error((string)__('No records selected.'));

            return $this->redirect($redirectUrl);
        }

        $batchIdsCount = count($batchIds);

        // broadcast batch ids event
        $event = new Event((string)EventName::BATCH_IDS(), $this, [
            $batchIds,
            $operation,
            $this->Auth->user()
        ]);
        $this->getEventManager()->dispatch($event);

        $batchIds = is_array($event->result) ? $event->result : $batchIds;

        if (empty($batchIds)) {
            $operation = strtolower(Inflector::humanize($operation));
            $this->Flash->error((string)__('Insufficient permissions to ' . $operation . ' the selected records.'));

            return $this->redirect($redirectUrl);
        }

        if ('delete' === $operation) {
            $primaryKey = $table->getPrimaryKey();
            if (! is_string($primaryKey)) {
                throw new UnsupportedPrimaryKeyException();
            }

            $conditions = [$primaryKey . ' IN' => $batchIds];
            // execute batch delete
            if ($table->deleteAll($conditions)) {
                $this->Flash->success(
                    (string)__(count($batchIds) . ' of ' . $batchIdsCount . ' selected records have been deleted.')
                );
            } else {
                $this->Flash->error((string)__('Selected records could not be deleted. Please, try again.'));
            }

            return $this->redirect($redirectUrl);
        }

        if ('edit' === $operation && (bool)$this->request->getData('batch.execute')) {
            $fields = (array)$this->request->getData($this->name);
            if (empty($fields)) {
                $this->Flash->error((string)__('Selected records could not be updated. No changes provided.'));

                return $this->redirect($redirectUrl);
            }

            $primaryKey = $table->getPrimaryKey();
            if (! is_string($primaryKey)) {
                throw new UnsupportedPrimaryKeyException();
            }

            $conditions = [$primaryKey . ' IN' => $batchIds];
            // execute batch edit
            if ($table->updateAll($fields, $conditions)) {
                $this->Flash->success(
                    (string)__(count($batchIds) . ' of ' . $batchIdsCount . ' selected records have been updated.')
                );
            } else {
                $this->Flash->error((string)__('Selected records could not be updated. Please, try again.'));
            }

            return $this->redirect($redirectUrl);
        }

        $this->set('entity', $table->newEntity());
        $this->set('fields', Field::getCsvView($table, $operation, true, true));
        $this->render('CsvMigrations.Common/batch');
    }
122462
protected function loadCronBatch(\Gems_Task_TaskRunnerBatch $batch)
    {
       $batch->addMessage(sprintf($this->_("Starting %s mail jobs"), $this->project->getName()));
       $batch->addTask('Mail\\AddAllMailJobsTask');

        // Check for unprocessed tokens, 
       $tracker = $this->loader->getTracker();
       $tracker->loadCompletedTokensBatch($batch, null, $this->currentUser->getUserId());
   }
1106787
protected function sendToRandomConnection($command)
    {
        $this->connect();

        $args = array();
        if (func_num_args() > 1) {
            $args = func_get_args();
            array_shift($args);
        }

        $i = $this->lastConnection = array_rand($this->connections);

        return call_user_func_array(array($this->connections[$i], $command), $args);
    }
983060
public function pushRequest(TaskEvent $event)
    {
        $task = $this->taskRepository->findByTaskId($event->getTask()->getUuid());
        if (!$task) {
            // current task is not managed by this bundle

            return;
        }

        $request = new Request(
            [],
            [],
            ['_task_id' => $event->getTask()->getUuid()],
            [],
            [],
            ['SERVER_NAME' => $task->getHost(), 'HTTPS' => $task->getScheme() === 'http' ? 'off' : 'on']
        );

        $this->requestStack->push($request);
    }
648977
public static function push($job, $data = '', $queue = null, $connection = null)
    {
        return static::$instance->connection($connection)->push($job, $data, $queue);
    }
1076370
public QuadBatch pushBatch (QuadBatch newBatch) {
    if (newBatch == null) return null;
    QuadBatch oldBatch = batch;
    batch.end();
    batch = beginBatch(newBatch);
    return oldBatch;
  }
863068
public function pushUrl($url)
    {
        $urls = is_array($url) ? $url : func_get_args();

        return $this->request($urls, 'urls', 'CdnUrlPusher');
    }
469400
function favorites_update_batch( $tid, $tag )
	{
		$params = array();
		$params['tid'] = $tid;
		$params['tag'] = $tag;
		return $this->oauth->post( 'favorites/tags/update_batch', $params);
	}