Class yii\queue\cli\SignalLoop

Inheritanceyii\queue\cli\SignalLoop » yii\base\BaseObject
Implementsyii\base\Configurable, yii\queue\cli\LoopInterface
Available since version2.0.2
Source Code https://github.com/yiisoft/yii2-queue/blob/master/cli/SignalLoop.php

Signal Loop.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$exitSignals array Of signals to exit from listening of the queue. yii\queue\cli\SignalLoop
$resumeSignals array Of signals to resume listening of the queue. yii\queue\cli\SignalLoop
$suspendSignals array Of signals to suspend listening of the queue. yii\queue\cli\SignalLoop

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$queue yii\queue\cli\Queue yii\queue\cli\SignalLoop

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\BaseObject
__construct() Constructor. yii\queue\cli\SignalLoop
__get() Returns the value of an object property. yii\base\BaseObject
__isset() Checks if a property is set, i.e. defined and not null. yii\base\BaseObject
__set() Sets value of an object property. yii\base\BaseObject
__unset() Sets an object property to null. yii\base\BaseObject
canContinue() Checks signals state. yii\queue\cli\SignalLoop
canGetProperty() Returns a value indicating whether a property can be read. yii\base\BaseObject
canSetProperty() Returns a value indicating whether a property can be set. yii\base\BaseObject
className() Returns the fully qualified name of this class. yii\base\BaseObject
hasMethod() Returns a value indicating whether a method is defined. yii\base\BaseObject
hasProperty() Returns a value indicating whether a property is defined. yii\base\BaseObject
init() Sets signal handlers. yii\queue\cli\SignalLoop

Property Details

$exitSignals public property

Of signals to exit from listening of the queue.

public array $exitSignals = [
    15,
    
2,
    
1
]
$queue protected property
protected yii\queue\cli\Queue $queue null
$resumeSignals public property

Of signals to resume listening of the queue. For example: SIGCONT

public array $resumeSignals = []
$suspendSignals public property

Of signals to suspend listening of the queue. For example: SIGTSTP

public array $suspendSignals = []

Method Details

__construct() public method

Constructor.

The default implementation does two things:

  • Initializes the object with the given configuration $config.
  • Call init().

If this method is overridden in a child class, it is recommended that

  • the last parameter of the constructor is a configuration array, like $config here.
  • call the parent implementation at the end of the constructor.
public void __construct ( $queue, array $config = [] )
$queue yii\queue\cli\Queue
$config array

Name-value pairs that will be used to initialize the object properties

canContinue() public method

Checks signals state.

public boolean canContinue ( )
return boolean

Whether to continue listening of the queue.

init() public method

Sets signal handlers.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

public void init ( )