Свойство | Тип | Описание | |
---|---|---|---|
$_status_before_enqueue_ | array | Status container, store some configuration information before serialize current instance(before enqueue). | |
$agents | array | The instances of Agent. | |
$agentsConfig | array | The configuration information of agents. | |
$availableHooks | array | The available hooks for balancing task. | |
$enableQueue | boolean | Whether to use the queue. | |
$firstAgent | string | null | The name of first agent. | |
$howToUseQueue | Closure | How to use the queue. | |
$pushedToQueue | boolean | Whether the current instance has already pushed to the queue system. | |
$scheme | array | example: [ 'Agent1' => '10 backup', 'Agent2' => '20 backup', ] | |
$serializer | SuperClosure\Serializer | An instance of class [SuperClosure\Serializer] for serialize closure objects. | |
$smsData | array | The data container of SMS/voice verify. |
Метод | Описание | |
---|---|---|
__call ( string $name, array $args ) | Overload method. | |
__callStatic ( string $name, array $args ) | Overload static method. | |
__construct ( boolean $autoBoot = true ) | Constructor | |
__sleep ( ) : array | Serialize magic method. | |
__wakeup ( ) | Deserialize magic method. | |
agent ( string $name ) | Set the first agent by name. | |
bootstrap ( ) | Boot balancing task for send SMS/voice verify. | |
cleanConfig ( ) | Tear down all the configuration information of agent. | |
cleanScheme ( ) | Tear down agent use scheme and prepare to create and start a new balancing task, so before do it must destroy old task instance. | |
config ( mixed $name = null, mixed $config = null, boolean $override = false ) : array | Set or get configuration information by agent name. | |
content ( string $content ) | Set the content for content SMS. | |
data ( array $data ) | Set the template data for template SMS. | |
getAgent ( string $name ) : mixed | Get a sms agent instance by agent name, if null, will try to create a new agent instance. | |
getData ( null | string $name = null ) : mixed | Get all the data of SMS/voice verify. | |
getTask ( ) : Toplan\TaskBalance\Task | Get or generate a balancing task instance for send SMS/voice verify. | |
hasAgent ( string $name ) : boolean | Whether to has specified agent. | |
make ( mixed $agentName = null, mixed $tempId = null ) : |
Create a sms instance send SMS, your can also set SMS templates or content at the same time. | |
push ( ) : mixed | Push to the queue by a custom method. | |
queue ( mixed $enable = null, mixed $handler = null ) : boolean | Set whether to use the queue system, and define how to use it. | |
scheme ( mixed $name = null, mixed $scheme = null ) : mixed | Set or get the dispatch scheme of agent by name. | |
send ( boolean $immediately = false ) : mixed | Start send SMS/voice verify. | |
template ( mixed $name, mixed $tempId = null ) | Set the template id for template SMS. | |
to ( string $mobile ) | Set the recipient`s mobile number. | |
voice ( integer | string | null $code = null ) : |
Create a sms instance send voice verify, your can also set verify code at the same time. |
Метод | Описание | |
---|---|---|
configuration ( ) | Configuration. | |
getSerializer ( ) : SuperClosure\Serializer | Get a closure serializer. | |
initAgentsConfig ( array $agents, array &$config ) | Try to initialize the specified agents` configuration information. | |
initScheme ( array &$config ) | Try to read the dispatch scheme of agent from config file. | |
initTask ( ) | Initialize the task. | |
modifyConfig ( string $key, array $value ) | Modify the configuration information of agent by name. | |
modifyScheme ( $key, $value ) | Modify the dispatch scheme of agent by name. | |
parseScheme ( array $options ) : array | Parsing the dispatch scheme. | |
reinstallHandlers ( array $handlers ) | Reinstall hooks` handlers for balancing task. | |
serializeHandlers ( ) : array | Serialize the hooks` handlers of balancing task | |
serializeOrDeserializeClosureAndReplace ( array &$options, integer | string $key ) | Serialize/deserialize the specified closure and replace the origin value. | |
serializeOrDeserializeScheme ( array $scheme ) : array | Serialize or deserialize the agent use scheme. | |
taskInitialized ( ) : boolean | Whether task initialized. | |
validateAgentName ( string $name ) | Validate the agent name. | |
validateConfig ( ) | validate configuration. |
public static __callStatic ( string $name, array $args ) | ||
$name | string | |
$args | array |
public __construct ( boolean $autoBoot = true ) | ||
$autoBoot | boolean |
public static bootstrap ( ) |
public static cleanConfig ( ) |
public static cleanScheme ( ) |
protected static getSerializer ( ) : SuperClosure\Serializer | ||
Результат | SuperClosure\Serializer |
public static getTask ( ) : Toplan\TaskBalance\Task | ||
Результат | Toplan\TaskBalance\Task |
protected static initAgentsConfig ( array $agents, array &$config ) | ||
$agents | array | |
$config | array |
protected static initScheme ( array &$config ) | ||
$config | array |
protected static modifyConfig ( string $key, array $value ) | ||
$key | string | |
$value | array |
protected static modifyScheme ( $key, $value ) | ||
$key | ||
$value |
protected static parseScheme ( array $options ) : array | ||
$options | array | |
Результат | array |
protected static reinstallHandlers ( array $handlers ) | ||
$handlers | array |
protected static serializeHandlers ( ) : array | ||
Результат | array |
protected static serializeOrDeserializeScheme ( array $scheme ) : array | ||
$scheme | array | |
Результат | array |
protected static taskInitialized ( ) : boolean | ||
Результат | boolean |
protected static validateAgentName ( string $name ) | ||
$name | string |
protected static validateConfig ( ) |
protected array $_status_before_enqueue_ | ||
Результат | array |
protected static array $agents | ||
Результат | array |
protected static array $agentsConfig | ||
Результат | array |
protected static array $availableHooks | ||
Результат | array |
protected static bool $enableQueue | ||
Результат | boolean |
protected static Closure $howToUseQueue | ||
Результат | Closure |
protected bool $pushedToQueue | ||
Результат | boolean |
protected static array $scheme | ||
Результат | array |
protected static Serializer,SuperClosure $serializer | ||
Результат | SuperClosure\Serializer |
protected array $smsData | ||
Результат | array |