This file contains the upgrade notes. These notes highlight changes that could break your application when you upgrade the package from one version to another.
\yii\queue\ErrorEvent
has been deprecated and will be removed in 3.0
.
Use \yii\queue\ExecEvent
instead.The Amqp driver has been deprecated and will be removed in 2.1
.
It is advised to migrate to Amqp Interop instead.
Added \yii\queue\cli\Command::isWorkerAction()
abstract method. If you use your own console
controllers to run queue listeners, you must implement it.
\yii\queue\cli\Signal
helper is deprecated and will be removed in 2.1
. The extension uses
\yii\queue\cli\SignalLoop
instead of the helper.
If you use your own console controller to listen to a queue, you must upgrade it. See the native console controllers for how to upgrade.
yii\queue\cli\Verbose
behavior was renamed to yii\queue\cli\VerboseBehavior
. The old class was
marked as deprecated and will be removed in 2.1.0
.
Job
, RetryableJob
and Serializer
interfaces were renamed to JobInterface
,
RetryableJobInterface
and SerializerInterface
. The old names are declared as deprecated
and will be removed in 2.1.0
.
zhuravljov\yii
to yii
namespace for
your project.Event Queue::EVENT_AFTER_EXEC_ERROR
renamed to Queue::EVENT_AFTER_ERROR
.
Removed method Queue::later()
. Use method chain Yii::$app->queue->delay(60)->push()
instead.
Changed table schema for DB driver. Apply migration.
Some methods and constants were modified.
Job::run()
modified to Job::execute($queue)
.Queue::EVENT_BEFORE_WORK
renamed to Queue::EVENT_BEFORE_EXEC
.Queue::EVENT_AFTER_WORK
renamed to Queue::EVENT_AFTER_EXEC
.Queue::EVENT_AFTER_ERROR
renamed to Queue::EVENT_AFTER_EXEC_ERROR
.Method Queue::sendMessage
renamed to Queue::pushMessage
. Check it if you use it in your own
custom drivers.
Yii::$app->queue->driver
you need to use the methods of Yii::$app->queue
.You also need to check your configs. For example, now the config for the db queue is:
'queue' => [
'class' => \zhuravljov\yii\queue\db\Queue::class,
'db' => 'db',
'tableName' => '{{%queue}}',
'channel' => 'default',
'mutex' => \yii\mutex\MysqlMutex::class,
],
Instead of the old variant:
'queue' => [
'class' => \zhuravljov\yii\queue\Queue::class,
'driver' => [
'class' => \yii\queue\db\Driver::class,
'db' => 'db',
'tableName' => '{{%queue}}'
'channel' => 'default',
'mutex' => \yii\mutex\MysqlMutex::class,
],
],