Configures the batch to transfer batches of requests. Associates a {@see \Guzzle\Http\BatchRequestTransfer}
object as both the transfer and divisor strategy.

@param int $batchSize Batch size for each batch of requests

@return BatchBuilder
11197
public function transferRequests($batchSize = 50)
    {
        $className = self::$mapping['request'];
        $this->transferStrategy = new $className($batchSize);
        $this->divisorStrategy = $this->transferStrategy;

        return $this;
    }
15512
protected function setMaxSize($maxSize)
    {
        $this->maxSize = $this->toBytes($maxSize);
        $this->maxSizeString = $this->fromBytes($this->maxSize);
        return $this;
    }
1302524
public function setBlockSize($size)
    {
        if ($size <= 1) {
            throw new \InvalidArgumentException("Pixel Size Must Be Greater Than One");
        }
        $this->size = (int) abs($size);

        return $this;
    }
711221
public function batchSize($num)
    {
        $this->batchSize = (integer) $num;
        $this->mongoCommandCursor->batchSize($num);

        return $this;
    }
746458
public function batchSize($batchSize)
    {
        if (null !== $batchSize) {
            if (!is_numeric($batchSize) || $batchSize != (int) $batchSize) {
                throw new \InvalidArgumentException('The batchSize is not valid.');
            }
            $batchSize = (int) $batchSize;
        }

        $this->batchSize = $batchSize;

        return $this;
    }
1012554
protected function prepareOrderItems(OrderTransfer $orderTransfer, AbstractRequestContainer $container): AbstractRequestContainer
    {
        $arrayIt = [];
        $arrayId = [];
        $arrayPr = [];
        $arrayNo = [];
        $arrayDe = [];
        $arrayVa = [];

        $key = 1;

        foreach ($orderTransfer->getItems() as $itemTransfer) {
            $arrayIt[$key] = PayoneApiConstants::INVOICING_ITEM_TYPE_GOODS;
            $arrayId[$key] = $itemTransfer->getSku();
            $arrayPr[$key] = $itemTransfer->getUnitGrossPrice();
            $arrayNo[$key] = $itemTransfer->getQuantity();
            $arrayDe[$key] = $itemTransfer->getName();
            $arrayVa[$key] = (int)$itemTransfer->getTaxRate();
            $key++;
        }

        $container->setIt($arrayIt);
        $container->setId($arrayId);
        $container->setPr($arrayPr);
        $container->setNo($arrayNo);
        $container->setDe($arrayDe);
        $container->setVa($arrayVa);

        return $container;
    }
237927
protected void batchHandle(Iterable<?> entities, BatchType batchType,
			int batchSize) {
		Session session = getCurrentSession();
		Iterator<?> it = entities.iterator();
		int count = 0;
		while (it.hasNext()) {
			count++;
			Object entity = it.next();
			switch (batchType) {
			case SAVE:
				session.save(entity);
				break;
			case UPDATE:
				session.update(entity);
				break;
			case SAVE_OR_UPDATE:
				session.saveOrUpdate(entity);
				break;
			case DELETE:
				session.delete(entity);
				break;
			}
			if (count % batchSize == 0) {
				session.flush();
				session.clear();
			}
		}
	}
1243434
public function sendBatchRequest(BatchRequest $request)
    {
        $response = $this->sendRequest($request);

        return new BatchResponse($request, $response);
    }
865149
public function setIsBatch($isBatch)
    {
        $this->batch = [];
        $this->isBatch = $isBatch;
        $mgr = $this->manager;
        $self = $this;
        return function () use ($mgr, $self) {
            $mgr->flush();
            $self->setIsBatch(true);
        };
    }
387111
public function setFont(\ZendPdf\Resource\Font\AbstractFont $font, $fontSize = null)
    {
        if (is_null($fontSize)) {
            $fontSize = $this->getFontSize();
        }

        return parent::setFont($font, $fontSize);
    }
24749
public function resizeTable(int $maxSize = null) {
        if ($maxSize !== null) {
            $this->maxSize = $maxSize;
        }

        while ($this->size > $this->maxSize) {
            list($name, $value) = \array_pop($this->headers);
            $this->size -= 32 + \strlen($name) + \strlen($value);
        }
    }
484993
public function batch($chunkSize)
    {
        $this->iterator = Iterators::batch($this->iterator, $chunkSize);
        return $this;
    }
1030189
public static BatchedWriteBehindConfigurationBuilder newBatchedWriteBehindConfiguration(long maxDelay, TimeUnit maxDelayUnit, int batchSize) {
    return new BatchedWriteBehindConfigurationBuilder(maxDelay, maxDelayUnit, batchSize);
  }
1136102
public final function do(): BatchInterface
    {
        // no need to get excited
        if (empty($this->queue)) {
            return $this;
        }

        // check transaction status
        $resource = $this->agent->getResource();
        /* if ($resource->getType() == Resource::TYPE_MYSQL_LINK) {
            // nope..
        } else */ if ($resource->getType() == Resource::TYPE_PGSQL_LINK) {
            $resource = $resource->getObject();
            $resourceStatus = pg_transaction_status($resource);
            if ($resourceStatus !== PGSQL_TRANSACTION_IDLE) do {
                time_nanosleep(0, 100000);
                $resourceStatus = pg_transaction_status($resource);
            } while ($resourceStatus === PGSQL_TRANSACTION_ACTIVE);
        }

        $startTime = microtime(true);

        $this->start(); // begin

        foreach ($this->queue as $query) {
            // @important (clone)
            $result = clone $this->agent->query($query);

            if ($result->getRowsAffected() > 0) {
                $this->results[] = $result;
            }

            unset($result);
        }

        $this->end(); // commit, go go go!

        $this->totalTime = (float) number_format(microtime(true) - $startTime, 10);

        $this->agent->getResult()->reset();

        return $this;
    }
1201320
public function setTransferType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\DataTransfer\V1\TransferType::class);
        $this->transfer_type = $var;

        return $this;
    }
187453
private function setFrame($bodySize)
    {
        $this->frame = $this->factory->createFrame(
            $this->command,
            $this->headers,
            (string)substr($this->buffer, $this->offset, $bodySize),
            $this->legacyMode
        );

        $this->expectedBodyLength = null;
        $this->headers = [];
        $this->mode = self::MODE_HEADER;
    }
1214514
public function expandCustomerTransferWithProductListIds(CustomerTransfer $customerTransfer): CustomerTransfer
    {
        if ($this->hasCustomerTransferProductLists($customerTransfer)) {
            return $customerTransfer;
        }

        $companyUserTransfer = $customerTransfer->getCompanyUserTransfer();

        if ($companyUserTransfer === null || $companyUserTransfer->getCompany() === null) {
            return $customerTransfer;
        }

        $productListCollectionTransfer = $this->productListReader->getProductListCollectionByIdCompanyId(
            $companyUserTransfer->getCompany()
        );

        $this->addProductListsToCustomerTransfer($customerTransfer, $productListCollectionTransfer);

        return $customerTransfer;
    }