Skip to content

Commit 2404a0a

Browse files
committed
2024-12-09までの原文変更点反映。
1 parent ca85c28 commit 2404a0a

File tree

6 files changed

+74
-6
lines changed

6 files changed

+74
-6
lines changed

original-en/collections.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ The `skip` method returns a new collection, with the given number of elements re
23042304
<a name="method-skipuntil"></a>
23052305
#### `skipUntil()` {.collection-method}
23062306

2307-
The `skipUntil` method skips over items from the collection until the given callback returns `true` and then returns the remaining items in the collection as a new collection instance:
2307+
The `skipUntil` method skips over items from the collection while the given callback returns `false`. Once the callback returns `true` all of the remaining items in the collection will be returned as a new collection:
23082308

23092309
$collection = collect([1, 2, 3, 4]);
23102310

@@ -2332,7 +2332,7 @@ You may also pass a simple value to the `skipUntil` method to skip all items unt
23322332
<a name="method-skipwhile"></a>
23332333
#### `skipWhile()` {.collection-method}
23342334

2335-
The `skipWhile` method skips over items from the collection while the given callback returns `true` and then returns the remaining items in the collection as a new collection:
2335+
The `skipWhile` method skips over items from the collection while the given callback returns `true`. Once the callback returns `false` all of the remaining items in the collection will be returned as a new collection:
23362336

23372337
$collection = collect([1, 2, 3, 4]);
23382338

original-en/deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ server {
7777
7878
error_page 404 /index.php;
7979
80-
location ~ \.php$ {
80+
location ~ ^/index\.php(/|$) {
8181
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
8282
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
8383
include fastcgi_params;

original-en/events.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,40 @@ As an alternative to defining how many times a listener may be attempted before
487487
return now()->addMinutes(5);
488488
}
489489

490+
<a name="specifying-queued-listener-backoff"></a>
491+
#### Specifying Queued Listener Backoff
492+
493+
If you would like to configure how many seconds Laravel should wait before retrying a listener that has encountered an exception, you may do so by defining a `backoff` property on your listener class:
494+
495+
/**
496+
* The number of seconds to wait before retrying the queued listener.
497+
*
498+
* @var int
499+
*/
500+
public $backoff = 3;
501+
502+
If you require more complex logic for determining the listeners's backoff time, you may define a `backoff` method on your listener class:
503+
504+
/**
505+
* Calculate the number of seconds to wait before retrying the queued listener.
506+
*/
507+
public function backoff(): int
508+
{
509+
return 3;
510+
}
511+
512+
You may easily configure "exponential" backoffs by returning an array of backoff values from the `backoff` method. In this example, the retry delay will be 1 second for the first retry, 5 seconds for the second retry, 10 seconds for the third retry, and 10 seconds for every subsequent retry if there are more attempts remaining:
513+
514+
/**
515+
* Calculate the number of seconds to wait before retrying the queued listener.
516+
*
517+
* @return array<int, int>
518+
*/
519+
public function backoff(): array
520+
{
521+
return [1, 5, 10];
522+
}
523+
490524
<a name="dispatching-events"></a>
491525
## Dispatching Events
492526

translation-ja/collections.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ $users->select(['name', 'role']);
23042304
<a name="method-skipuntil"></a>
23052305
#### `skipUntil()` {.collection-method}
23062306

2307-
`skipUntil`メソッドは、指定したコールバックが`true`を返すまでコレクションからアイテムをスキップし、コレクション内の残りのアイテムを新しいコレクションインスタンスとして返します
2307+
`skipUntil`メソッドは、指定コールバックが`false`を返す間、コレクション内のアイテムをスキップします。コールバックが`true`を返すと、コレクションに残っている全てのアイテムを新しいコレクションとして返します
23082308

23092309
$collection = collect([1, 2, 3, 4]);
23102310

@@ -2332,7 +2332,7 @@ $users->select(['name', 'role']);
23322332
<a name="method-skipwhile"></a>
23332333
#### `skipWhile()` {.collection-method}
23342334

2335-
`skipWhile`メソッドは、指定したコールバックが`true`を返す間、コレクションからアイテムをスキップし、コレクション内の残りのアイテムを新しいコレクションとして返します
2335+
`skipWhile`メソッドは、指定コールバックが`true`を返す間、コレクション内のアイテムをスキップします。コールバックが`false`を返すと、コレクションに残っている全てのアイテムを新しいコレクションとして返します
23362336

23372337
$collection = collect([1, 2, 3, 4]);
23382338

translation-ja/deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ server {
7777
7878
error_page 404 /index.php;
7979
80-
location ~ \.php$ {
80+
location ~ ^/index\.php(/|$) {
8181
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
8282
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
8383
include fastcgi_params;

translation-ja/events.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,40 @@ php artisan event:list
487487
return now()->addMinutes(5);
488488
}
489489

490+
<a name="specifying-queued-listener-backoff"></a>
491+
#### キュー投入済みリスナの再試行待ち秒数指定
492+
493+
例外が発生したリスナを再試行する前に、Laravelが何秒待つかを設定したい場合は、リスナクラスへ`backoff`プロパティを定義してください。
494+
495+
/**
496+
* キュー投入済みリスナを再試行する前に何秒待つか
497+
*
498+
* @var int
499+
*/
500+
public $backoff = 3;
501+
502+
リスナの再試行待ち時間を決定するため、より複雑なロジックが必要な場合は、リスナクラスに`backoff`メソッドを定義してください。
503+
504+
/**
505+
* キュー投入済みリスナを再試行するまで待つ秒数の計算
506+
*/
507+
public function backoff(): int
508+
{
509+
return 3;
510+
}
511+
512+
`backoff`メソッドからバックオフ値の配列を返すことで、簡単に「指数関数的」な待ち秒数が設定できます。この例では、リトライの遅延は最初のリトライで1秒、2回目のリトライで5秒、3回目のリトライで10秒、それ以降もリトライが残っている場合は毎回10秒となります:
513+
514+
/**
515+
* キュー投入済みリスナを再試行するまで待つ秒数の計算
516+
*
517+
* @return array<int, int>
518+
*/
519+
public function backoff(): array
520+
{
521+
return [1, 5, 10];
522+
}
523+
490524
<a name="dispatching-events"></a>
491525
## イベント発行
492526

0 commit comments

Comments
 (0)