Property | Type | Description | |
---|---|---|---|
$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. |
Method | Description | |
---|---|---|
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. |
Method | Description | |
---|---|---|
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. |
return | UrbanIndo\Yii2\Queue\Job | The job. |
protected deserializeMessage ( array $array ) : array | ||
$array | array | The message to be deserialize. |
return | array |
abstract protected releaseJob ( UrbanIndo\Yii2\Queue\Job $job ) : boolean | ||
$job | UrbanIndo\Yii2\Queue\Job | The job to release. |
return | boolean | whether the operation succeed. |
protected serializeMessage ( mixed $array ) : array | ||
$array | mixed | Array to serialize. |
return | array |
public Module,yii\base $module | ||
return |
public bool $releaseOnFailure | ||
return | boolean |