PHP Класс 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.
С версии: 2.0.0
Наследование: implements Traversable, implements Collectable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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

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

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

public addRef ( )

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

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
Результат array An array of items from the objects member table

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

public count ( )

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

public delRef ( )

extend() публичный статический Метод

public static extend ( object $obj )
$obj object

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

public getRefCount ( ) : integer
Результат integer

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

public isGarbage ( ) : boolean
Результат boolean

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

Tell if the referenced object is executing
public isRunning ( ) : boolean
Результат boolean A boolean indication of state

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

Tell if the referenced object exited, suffered fatal errors, or threw uncaught exceptions during execution
public isTerminated ( ) : boolean
Результат boolean A boolean indication of state

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

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
Результат boolean A boolean indication of success

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

Send notification to the referenced object
public notify ( ) : boolean
Результат boolean A boolean indication of success

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

public notifyOne ( )

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

public offsetExists ( $offset )

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

public offsetGet ( $offset )

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

public offsetSet ( $offset, $value )

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

public offsetUnset ( $offset )

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

Pops an item from the objects property table
public pop ( ) : mixed
Результат mixed The last item from the objects properties table

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

The programmer should always implement the run method for objects that are intended for execution.
public run ( ) : void
Результат void The methods return value, if used, will be ignored

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

Shifts an item from the objects properties table
public shift ( ) : mixed
Результат mixed The first item from the objects properties table

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

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
Результат mixed The return value from the block

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

Waits for notification from the Stackable
public wait ( integer $timeout ) : boolean
$timeout integer An optional timeout in microseconds
Результат boolean A boolean indication of success