PHP Class phprs\util\MessagePump

Author: caoym
Afficher le fichier Open project: caoym/phprs-restful

Méthodes publiques

Méthode Description
closeQueue ( integer $queue_id ) : void 关闭一个消息队列,队列中未执行的操作将不会再执行
newQueue ( callable $onEnd = null ) : integer 创建一个新的消息队列
pushAction ( $queue_id, callable $action, array $args, $exception_handle, string $desc, $immediately = false ) : void 加入常规执行消息
pushIdle ( $queue_id, callable $action, $args, callable $exception_handle, string $desc ) : void 加入空闲执行消息
run ( ) : void 运行消息循环

Private Methods

Méthode Description
callAction ( unknown $queue_id, unknown $action )

Method Details

closeQueue() public méthode

关闭一个消息队列,队列中未执行的操作将不会再执行
public closeQueue ( integer $queue_id ) : void
$queue_id integer
Résultat void

newQueue() public méthode

创建一个新的消息队列
public newQueue ( callable $onEnd = null ) : integer
$onEnd callable 当队列执行完后调用
Résultat integer 队列id

pushAction() public méthode

加入常规执行消息
public pushAction ( $queue_id, callable $action, array $args, $exception_handle, string $desc, $immediately = false ) : void
$action callable 调用方法
$args array 调用参数
$desc string 描述信息
Résultat void

pushIdle() public méthode

加入空闲执行消息
public pushIdle ( $queue_id, callable $action, $args, callable $exception_handle, string $desc ) : void
$action callable
$exception_handle callable
$desc string 描述信息
Résultat void

run() public méthode

运行消息循环
public run ( ) : void
Résultat void