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.
상속: implements Traversable, implements Collectable
파일 보기 프로젝트 열기: robske110/ClearSky 1 사용 예제들

공개 메소드들

메소드 설명
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