commit | author | age
|
2207d6
|
1 |
Upgrading Instructions |
W |
2 |
====================== |
|
3 |
|
|
4 |
This file contains the upgrade notes. These notes highlight changes that could break your |
|
5 |
application when you upgrade the package from one version to another. |
|
6 |
|
|
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 |
|
|
13 |
Upgrade from 2.0.1 to 2.0.2 |
|
14 |
--------------------------- |
|
15 |
|
|
16 |
* The [Amqp driver](docs/guide/driver-amqp.md) has been deprecated and will be removed in `2.1`. |
|
17 |
It is advised to migrate to [Amqp Interop](docs/guide/driver-amqp-interop.md) instead. |
|
18 |
|
|
19 |
* Added `\yii\queue\cli\Command::isWorkerAction()` abstract method. If you use your own console |
|
20 |
controllers to run queue listeners, you must implement it. |
|
21 |
|
|
22 |
* `\yii\queue\cli\Signal` helper is deprecated and will be removed in `2.1`. The extension uses |
|
23 |
`\yii\queue\cli\SignalLoop` instead of the helper. |
|
24 |
|
|
25 |
* If you use your own console controller to listen to a queue, you must upgrade it. See the native |
|
26 |
console controllers for how to upgrade. |
|
27 |
|
|
28 |
Upgrade from 2.0.0 to 2.0.1 |
|
29 |
--------------------------- |
|
30 |
|
|
31 |
* `yii\queue\cli\Verbose` behavior was renamed to `yii\queue\cli\VerboseBehavior`. The old class was |
|
32 |
marked as deprecated and will be removed in `2.1.0`. |
|
33 |
|
|
34 |
* `Job`, `RetryableJob` and `Serializer` interfaces were renamed to `JobInterface`, |
|
35 |
`RetryableJobInterface` and `SerializerInterface`. The old names are declared as deprecated |
|
36 |
and will be removed in `2.1.0`. |
|
37 |
|
|
38 |
Upgrade from 1.1.0 to 2.0.0 |
|
39 |
--------------------------- |
|
40 |
|
|
41 |
* Code has been moved to yii namespace. Check and replace `zhuravljov\yii` to `yii` namespace for |
|
42 |
your project. |
|
43 |
|
|
44 |
Upgrade from 1.0.0 to 1.1.0 |
|
45 |
--------------------------- |
|
46 |
|
|
47 |
* Event `Queue::EVENT_AFTER_EXEC_ERROR` renamed to `Queue::EVENT_AFTER_ERROR`. |
|
48 |
|
|
49 |
* Removed method `Queue::later()`. Use method chain `Yii::$app->queue->delay(60)->push()` instead. |
|
50 |
|
|
51 |
* Changed table schema for DB driver. Apply migration. |
|
52 |
|
|
53 |
|
|
54 |
Upgrade from 0.x to 1.0.0 |
|
55 |
------------------------- |
|
56 |
|
|
57 |
* Some methods and constants were modified. |
|
58 |
|
|
59 |
- Method `Job::run()` modified to `Job::execute($queue)`. |
|
60 |
- Const `Queue::EVENT_BEFORE_WORK` renamed to `Queue::EVENT_BEFORE_EXEC`. |
|
61 |
- Const `Queue::EVENT_AFTER_WORK` renamed to `Queue::EVENT_AFTER_EXEC`. |
|
62 |
- Const `Queue::EVENT_AFTER_ERROR` renamed to `Queue::EVENT_AFTER_EXEC_ERROR`. |
|
63 |
|
|
64 |
* Method `Queue::sendMessage` renamed to `Queue::pushMessage`. Check it if you use it in your own |
|
65 |
custom drivers. |
|
66 |
|
|
67 |
|
|
68 |
Upgrade from 0.10.1 |
|
69 |
------------------- |
|
70 |
|
|
71 |
* Driver property was removed and this functionality was moved into queue classes. If you use public |
|
72 |
methods of `Yii::$app->queue->driver` you need to use the methods of `Yii::$app->queue`. |
|
73 |
|
|
74 |
You also need to check your configs. For example, now the config for the db queue is: |
|
75 |
|
|
76 |
```php |
|
77 |
'queue' => [ |
|
78 |
'class' => \zhuravljov\yii\queue\db\Queue::class, |
|
79 |
'db' => 'db', |
|
80 |
'tableName' => '{{%queue}}', |
|
81 |
'channel' => 'default', |
|
82 |
'mutex' => \yii\mutex\MysqlMutex::class, |
|
83 |
], |
|
84 |
``` |
|
85 |
|
|
86 |
Instead of the old variant: |
|
87 |
|
|
88 |
```php |
|
89 |
'queue' => [ |
|
90 |
'class' => \zhuravljov\yii\queue\Queue::class, |
|
91 |
'driver' => [ |
|
92 |
'class' => \yii\queue\db\Driver::class, |
|
93 |
'db' => 'db', |
|
94 |
'tableName' => '{{%queue}}' |
|
95 |
'channel' => 'default', |
|
96 |
'mutex' => \yii\mutex\MysqlMutex::class, |
|
97 |
], |
|
98 |
], |
|
99 |
``` |