Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/cn/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// 在发送 HTTP 响应后做一些事情
Expand Down
4 changes: 2 additions & 2 deletions docs/es/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// Haz algo después de enviar la respuesta HTTP
Expand Down
4 changes: 2 additions & 2 deletions docs/fr/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// Faire quelque chose après l'envoi de la réponse HTTP
Expand Down
4 changes: 2 additions & 2 deletions docs/it/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// Esegui qualcosa dopo aver inviato la risposta HTTP
Expand Down
4 changes: 2 additions & 2 deletions docs/ja/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// HTTPレスポンス送信後に何らかの処理を実行
Expand Down
4 changes: 2 additions & 2 deletions docs/pt-br/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// Faz algo depois de enviar a resposta HTTP
Expand Down
4 changes: 2 additions & 2 deletions docs/ru/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// Действия после отправки HTTP-ответа
Expand Down
4 changes: 2 additions & 2 deletions docs/tr/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// HTTP yanıtını gönderdikten sonra bir şey yapın
Expand Down
8 changes: 4 additions & 4 deletions docs/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ $handler = static function () use ($myApp) {
}
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);

// Do something after sending the HTTP response
Expand Down Expand Up @@ -155,8 +155,8 @@ $handler = static function () use ($myApp, $creator) {
echo $response->getBody();
};

$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 0);
for ($nbRequests = 0; !$maxRequests || $nbRequests < $maxRequests; ++$nbRequests) {
$maxRequests = (isset($_SERVER['MAX_REQUESTS']) && $_SERVER['MAX_REQUESTS'] > 0) ? (int)$_SERVER['MAX_REQUESTS'] : PHP_INT_MAX;
for ($nbRequests = 0; $nbRequests < $maxRequests; ++$nbRequests) {
$keepRunning = \frankenphp_handle_request($handler);
gc_collect_cycles();
if (!$keepRunning) break;
Expand Down