PHP Class Worker, ClearSky

Inheritance: extends Base
Mostra file Open project: robske110/ClearSky Class Usage Examples

Public Methods

Method Description
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

Method Details

collect() public method

Collects finished objects
public collect ( callable $function ) : void
$function callable
return void

collector() public method

public collector ( Collectable $collectable )
$collectable Collectable

getStacked() public method

Returns the number of threaded tasks waiting to be executed by the referenced Worker
public getStacked ( ) : integer
return integer An integral value

isShutdown() public method

Tell if the referenced Worker has been shutdown
public isShutdown ( ) : boolean
return boolean A boolean indication of state

shutdown() public method

Shuts down the Worker after executing all the threaded tasks previously stacked
public shutdown ( ) : boolean
return boolean A boolean indication of success

stack() public method

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
return integer The new length of the stack

unstack() public method

Removes the first item from the stack
public unstack ( ) : integer
return integer The new length of the stack