PHP Class Threaded, ClearSky

Threaded objects form the basis of pthreads ability to execute user code asynchronously; they expose and include synchronization methods and various useful interfaces. Threaded objects, most importantly, provide implicit safety for the programmer; all operations on the object scope are safe.
Inheritance: implements Traversable, implements Collectable
Afficher le fichier Open project: robske110/ClearSky Class Usage Examples

Méthodes publiques

Méthode Description
addRef ( )
chunk ( integer $size, boolean $preserve = false ) : array Fetches a chunk of the objects properties table of the given size
count ( )
delRef ( )
extend ( object $obj )
getRefCount ( ) : integer
isGarbage ( ) : boolean
isRunning ( ) : boolean Tell if the referenced object is executing
isTerminated ( ) : boolean Tell if the referenced object exited, suffered fatal errors, or threw uncaught exceptions during execution
merge ( mixed $from, boolean $overwrite = true ) : boolean Merges data into the current object
notify ( ) : boolean Send notification to the referenced object
notifyOne ( )
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
pop ( ) : mixed Pops an item from the objects property table
run ( ) : void The programmer should always implement the run method for objects that are intended for execution.
shift ( ) : mixed Shifts an item from the objects properties table
synchronized ( Closure $function, mixed $args = null ) : mixed Executes the block while retaining the synchronization lock for the current context.
wait ( integer $timeout ) : boolean Waits for notification from the Stackable

Method Details

addRef() public méthode

public addRef ( )

chunk() public méthode

Fetches a chunk of the objects properties table of the given size
public chunk ( integer $size, boolean $preserve = false ) : array
$size integer The number of items to fetch
$preserve boolean default false
Résultat array An array of items from the objects member table

count() public méthode

public count ( )

delRef() public méthode

public delRef ( )

extend() public static méthode

public static extend ( object $obj )
$obj object

getRefCount() public méthode

public getRefCount ( ) : integer
Résultat integer

isGarbage() public méthode

public isGarbage ( ) : boolean
Résultat boolean

isRunning() public méthode

Tell if the referenced object is executing
public isRunning ( ) : boolean
Résultat boolean A boolean indication of state

isTerminated() public méthode

Tell if the referenced object exited, suffered fatal errors, or threw uncaught exceptions during execution
public isTerminated ( ) : boolean
Résultat boolean A boolean indication of state

merge() public méthode

Merges data into the current object
public merge ( mixed $from, boolean $overwrite = true ) : boolean
$from mixed The data to merge
$overwrite boolean Overwrite existing keys flag, by default true
Résultat boolean A boolean indication of success

notify() public méthode

Send notification to the referenced object
public notify ( ) : boolean
Résultat boolean A boolean indication of success

notifyOne() public méthode

public notifyOne ( )

offsetExists() public méthode

public offsetExists ( $offset )

offsetGet() public méthode

public offsetGet ( $offset )

offsetSet() public méthode

public offsetSet ( $offset, $value )

offsetUnset() public méthode

public offsetUnset ( $offset )

pop() public méthode

Pops an item from the objects property table
public pop ( ) : mixed
Résultat mixed The last item from the objects properties table

run() public méthode

The programmer should always implement the run method for objects that are intended for execution.
public run ( ) : void
Résultat void The methods return value, if used, will be ignored

shift() public méthode

Shifts an item from the objects properties table
public shift ( ) : mixed
Résultat mixed The first item from the objects properties table

synchronized() public méthode

Executes the block while retaining the synchronization lock for the current context.
public synchronized ( Closure $function, mixed $args = null ) : mixed
$function Closure The block of code to execute
$args mixed ... Variable length list of arguments to use as function arguments to the block
Résultat mixed The return value from the block

wait() public méthode

Waits for notification from the Stackable
public wait ( integer $timeout ) : boolean
$timeout integer An optional timeout in microseconds
Résultat boolean A boolean indication of success