PHP Класс Worker, ClearSky

Наследование: extends Base
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
collect ( callable $function ) : void Collects finished objects
collector ( Collectable $collectable )
getStacked ( ) : integer Returns the number of threaded tasks waiting to be executed by the referenced Worker
isShutdown ( ) : boolean Tell if the referenced Worker has been shutdown
shutdown ( ) : boolean Shuts down the Worker after executing all the threaded tasks previously stacked
stack ( Collectable &$work ) : integer Appends the referenced object to the stack of the referenced Worker
unstack ( ) : integer Removes the first item from the stack

Описание методов

collect() публичный Метод

Collects finished objects
public collect ( callable $function ) : void
$function callable
Результат void

collector() публичный Метод

public collector ( Collectable $collectable )
$collectable Collectable

getStacked() публичный Метод

Returns the number of threaded tasks waiting to be executed by the referenced Worker
public getStacked ( ) : integer
Результат integer An integral value

isShutdown() публичный Метод

Tell if the referenced Worker has been shutdown
public isShutdown ( ) : boolean
Результат boolean A boolean indication of state

shutdown() публичный Метод

Shuts down the Worker after executing all the threaded tasks previously stacked
public shutdown ( ) : boolean
Результат boolean A boolean indication of success

stack() публичный Метод

Appends the referenced object to the stack of the referenced Worker
public stack ( Collectable &$work ) : integer
$work Collectable Collectable object to be executed by the referenced Worker
Результат integer The new length of the stack

unstack() публичный Метод

Removes the first item from the stack
public unstack ( ) : integer
Результат integer The new length of the stack