PHP Class Cml\Vendor\PhpThread

Afficher le fichier Open project: linhecheng/cmlphp

Méthodes publiques

Свойство Type Description
$success array 已完成的任务队列(查看处理结果)

Protected Properties

Свойство Type Description
$queue array 线程队列
$tasks array 当前任务队列

Méthodes publiques

Méthode Description
__construct ( integer $max = 10, boolean $saveSuccess = false, integer $readDataLen = 1024, integer $timeout = 3 ) 构造函数
add ( string $host, string $path = '/' ) 往线程队列添加任务
getSuccessInfo ( ) : array 已完成的任务队列(查看处理结果)
run ( ) : array 执行线程队列里的所有任务

Private Methods

Méthode Description
makeTask ( ) : integer 创建任务
processTask ( array &$task ) 处理任务

Method Details

__construct() public méthode

构造函数
public __construct ( integer $max = 10, boolean $saveSuccess = false, integer $readDataLen = 1024, integer $timeout = 3 )
$max integer 最大线程数
$saveSuccess boolean 是否保存成功的信息
$readDataLen integer 读取的字节数
$timeout integer 等待超时时间

add() public méthode

往线程队列添加任务
public add ( string $host, string $path = '/' )
$host string 服务器
$path string 任务程序路径

getSuccessInfo() public méthode

已完成的任务队列(查看处理结果)
public getSuccessInfo ( ) : array
Résultat array

run() public méthode

执行线程队列里的所有任务
public run ( ) : array
Résultat array

Property Details

$queue protected_oe property

线程队列
protected array $queue
Résultat array

$success public_oe property

已完成的任务队列(查看处理结果)
public array $success
Résultat array

$tasks protected_oe property

当前任务队列
protected array $tasks
Résultat array