Свойство | Тип | Описание | |
---|---|---|---|
$module | To add the module, create a new module in the config e.g. create a module named 'task'. 'modules' => [ 'task' => [ 'class' => 'app\modules\task\Module', ] ] and then add the module to the queue config. 'components' => [ 'queue' => [ 'module' => 'task' ] ] | ||
$releaseOnFailure | boolean | This will release automatically on execution failure. i.e. when the run method returns false or catch exception. | |
$serializer | string | Choose the serializer. |
Метод | Описание | |
---|---|---|
delete ( UrbanIndo\Yii2\Queue\Job $job ) : boolean | Delete the job. This will trigger event EVENT_BEFORE_DELETE and EVENT_AFTER_DELETE. | |
fetch ( ) : UrbanIndo\Yii2\Queue\Job | boolean | Return next job from the queue. This will trigger event EVENT_BEFORE_FETCH and event EVENT_AFTER_FETCH | |
getSize ( ) : integer | Returns the number of queue size. | |
init ( ) : void | Initializes the module. | |
post ( UrbanIndo\Yii2\Queue\Job &$job ) : boolean | Post new job to the queue. This will trigger event EVENT_BEFORE_POST and EVENT_AFTER_POST. | |
purge ( ) : boolean | Purge the whole queue. | |
release ( UrbanIndo\Yii2\Queue\Job $job ) : boolean | Release the job. This will trigger event EVENT_BEFORE_RELEASE and EVENT_AFTER_RELEASE. | |
run ( UrbanIndo\Yii2\Queue\Job $job ) : void | Run the job. |
Метод | Описание | |
---|---|---|
deleteJob ( UrbanIndo\Yii2\Queue\Job $job ) : boolean | Delete the job. Override this for the queue implementation. | |
deserialize ( string $message ) : UrbanIndo\Yii2\Queue\Job | Deserialize job to be executed. | |
deserializeMessage ( array $array ) : array | ||
fetchJob ( ) : UrbanIndo\Yii2\Queue\Job | boolean | Return next job from the queue. Override this for queue implementation. | |
postJob ( UrbanIndo\Yii2\Queue\Job $job ) : boolean | Post new job to the queue. Override this for queue implementation. | |
releaseJob ( UrbanIndo\Yii2\Queue\Job $job ) : boolean | Release the job. Override this for the queue implementation. | |
serialize ( UrbanIndo\Yii2\Queue\Job $job ) : string | Pack job so that it can be send. | |
serializeMessage ( mixed $array ) : array |
protected deserialize ( string $message ) : UrbanIndo\Yii2\Queue\Job | ||
$message | string | The json string. |
Результат | UrbanIndo\Yii2\Queue\Job | The job. |
protected deserializeMessage ( array $array ) : array | ||
$array | array | The message to be deserialize. |
Результат | array |
abstract protected releaseJob ( UrbanIndo\Yii2\Queue\Job $job ) : boolean | ||
$job | UrbanIndo\Yii2\Queue\Job | The job to release. |
Результат | boolean | whether the operation succeed. |
protected serializeMessage ( mixed $array ) : array | ||
$array | mixed | Array to serialize. |
Результат | array |
public Module,yii\base $module | ||
Результат |
public bool $releaseOnFailure | ||
Результат | boolean |