Skip to content

Commit d291834

Browse files
committed
ErrorEvent mark as deprecated
1 parent ecaf6cf commit d291834

19 files changed

+65
-56
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Yii2 Queue Extension Change Log
99
- Bug #269: Handling of broken messages that are not unserialized correctly (zhuravljov)
1010
- Bug #267: Fixed symfony/process incompatibility (rob006)
1111
- Enh: Job execution result that forwarded to the event handler (zhuravljov)
12+
- Enh: ErrorEvent mark as deprecated (zhuravljov)
1213

1314
2.1.0 May 24, 2018
1415
------------------

UPGRADE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Upgrading Instructions
44
This file contains the upgrade notes. These notes highlight changes that could break your
55
application when you upgrade the package from one version to another.
66

7+
Upgrade to 2.1.1
8+
----------------
9+
10+
* `\yii\queue\ErrorEvent` has been deprecated and will be removed in `3.0`.
11+
Use `\yii\queue\ExecEvent` instead.
12+
713
Upgrade from 2.0.1 to 2.0.2
814
---------------------------
915

docs/guide-ja/retryable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Yii::$app->queue->on(Queue::EVENT_BEFORE_PUSH, function (PushEvent $event) {
9292
そして `Queue::EVENT_AFTER_ERROR` イベントを使って、もう一度試行するかどうかを決定することが出来ます。
9393

9494
```php
95-
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ErrorEvent $event) {
95+
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ExecEvent $event) {
9696
if ($event->job instanceof SomeJob) {
9797
$event->retry = ($event->attempt < 5) && ($event->error instanceof TemporaryException);
9898
}

docs/guide-ja/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ return [
135135
| Queue::EVENT_AFTER_PUSH | PushEvent | `Queue::push()` メソッドを使ってジョブをキューに追加した後 |
136136
| Queue::EVENT_BEFORE_EXEC | ExecEvent | ジョブを実行する前 |
137137
| Queue::EVENT_AFTER_EXEC | ExecEvent | ジョブが完了した後 |
138-
| Queue::EVENT_AFTER_ERROR | ErrorEvent | ジョブ実行中にキャッチされない例外が発生したとき |
138+
| Queue::EVENT_AFTER_ERROR | ExecEvent | ジョブ実行中にキャッチされない例外が発生したとき |
139139
| cli\Queue:EVENT_WORKER_START | WorkerEvent | ワーカが開始されたとき |
140140
| cli\Queue:EVENT_WORKER_LOOP | WorkerEvent | キューに対するリクエストを繰り返すたびに |
141141
| cli\Queue:EVENT_WORKER_STOP | WorkerEvent | ワーカが停止されたとき |

docs/guide-ru/retryable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Yii::$app->queue->on(Queue::EVENT_BEFORE_PUSH, function (PushEvent $event) {
8484
А событие `Queue::EVENT_AFTER_ERROR` — чтобы определить задание на повторную попытку:
8585

8686
```php
87-
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ErrorEvent $event) {
87+
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ExecEvent $event) {
8888
if ($event->job instanceof SomeJob) {
8989
$event->retry = ($event->attempt < 5) && ($event->error instanceof TemporaryException);
9090
}

docs/guide-ru/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ return [
137137
| Queue::EVENT_AFTER_PUSH | PushEvent | Добавление задания в очередь используя метод `Queue::push()` |
138138
| Queue::EVENT_BEFORE_EXEC | ExecEvent | Перед каждым выполнением задания |
139139
| Queue::EVENT_AFTER_EXEC | ExecEvent | После каждого успешного выполнения задания |
140-
| Queue::EVENT_AFTER_ERROR | ErrorEvent | Если при выполнение задания случилось непойманное исключение |
140+
| Queue::EVENT_AFTER_ERROR | ExecEvent | Если при выполнение задания случилось непойманное исключение |
141141
| cli\Queue:EVENT_WORKER_START | WorkerEvent | В момент запуска нового воркера |
142142
| cli\Queue:EVENT_WORKER_LOOP | WorkerEvent | В цикле между опросами очереди |
143143
| cli\Queue:EVENT_WORKER_STOP | WorkerEvent | В момент остановки воркера |

docs/guide-zh-CN/retryable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Yii::$app->queue->on(Queue::EVENT_BEFORE_PUSH, function (PushEvent $event) {
7373
并且 `Queue::EVENT_AFTER_ERROR` 事件可用于设置新的尝试:
7474

7575
```php
76-
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ErrorEvent $event) {
76+
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ExecEvent $event) {
7777
if ($event->job instanceof SomeJob) {
7878
$event->retry = ($event->attempt < 5) && ($event->error instanceof TemporaryException);
7979
}

docs/guide-zh-CN/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ return [
133133
| Queue::EVENT_AFTER_PUSH | PushEvent | Adding job to queue using `Queue::push()` method |
134134
| Queue::EVENT_BEFORE_EXEC | ExecEvent | Before each job execution |
135135
| Queue::EVENT_AFTER_EXEC | ExecEvent | After each success job execution |
136-
| Queue::EVENT_AFTER_ERROR | ErrorEvent | When uncaught exception occurred during the job execution |
136+
| Queue::EVENT_AFTER_ERROR | ExecEvent | When uncaught exception occurred during the job execution |
137137
| cli\Queue:EVENT_WORKER_START | WorkerEvent | When worker has been started |
138138
| cli\Queue:EVENT_WORKER_LOOP | WorkerEvent | Each iteration between requests to queue |
139139
| cli\Queue:EVENT_WORKER_STOP | WorkerEvent | When worker has been stopped |

docs/guide/retryable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Yii::$app->queue->on(Queue::EVENT_BEFORE_PUSH, function (PushEvent $event) {
9292
And the `Queue::EVENT_AFTER_ERROR` event can be used to decide whether to try another attempt:
9393

9494
```php
95-
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ErrorEvent $event) {
95+
Yii::$app->queue->on(Queue::EVENT_AFTER_ERROR, function (ExecEvent $event) {
9696
if ($event->job instanceof SomeJob) {
9797
$event->retry = ($event->attempt < 5) && ($event->error instanceof TemporaryException);
9898
}

docs/guide/usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ The queue triggers the following events:
135135
| Queue::EVENT_AFTER_PUSH | PushEvent | after adding a job to queue using `Queue::push()` method |
136136
| Queue::EVENT_BEFORE_EXEC | ExecEvent | before executing a job |
137137
| Queue::EVENT_AFTER_EXEC | ExecEvent | after successful job execution |
138-
| Queue::EVENT_AFTER_ERROR | ErrorEvent | on uncaught exception during the job execution |
138+
| Queue::EVENT_AFTER_ERROR | ExecEvent | on uncaught exception during the job execution |
139139
| cli\Queue:EVENT_WORKER_START | WorkerEvent | when worker has been started |
140140
| cli\Queue:EVENT_WORKER_LOOP | WorkerEvent | on each iteration between requests to queue |
141141
| cli\Queue:EVENT_WORKER_STOP | WorkerEvent | when worker has been stopped |

0 commit comments

Comments
 (0)