Genisys  Genisys API 1.9.3
A server software for Minecraft: Pocket Edition with many features
Threaded Class Reference
Inheritance diagram for Threaded:
[legend]
Collaboration diagram for Threaded:
[legend]

Public Member Functions

 chunk ($size, bool $preserve=false)
 
 count ()
 
 isRunning ()
 
 isTerminated ()
 
 merge ($from, $overwrite=true)
 
 notify ()
 
 notifyOne ()
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 pop ()
 
 run ()
 
 shift ()
 
 synchronized (\Closure $function, $args=null)
 
 wait ($timeout)
 
 getRefCount ()
 
 addRef ()
 
 delRef ()
 
 isGarbage ()
 

Static Public Member Functions

static extend ($obj)
 

Detailed Description

Threaded class

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

Member Function Documentation

chunk (   $size,
bool  $preserve = false 
)

Fetches a chunk of the objects properties table of the given size

Parameters
int$sizeThe number of items to fetch
bool$preservedefault false
Returns
array An array of items from the objects member table http://www.php.net/manual/en/threaded.chunk.php
count ( )

{}

static extend (   $obj)
static
Parameters
object$obj
getRefCount ( )
Returns
int
isGarbage ( )
Returns
bool

Implements Collectable.

isRunning ( )

Tell if the referenced object is executing

bool A boolean indication of state

isTerminated ( )

Tell if the referenced object exited, suffered fatal errors, or threw uncaught exceptions during execution

bool A boolean indication of state

merge (   $from,
  $overwrite = true 
)

Merges data into the current object

Parameters
mixed$fromThe data to merge
bool$overwriteOverwrite existing keys flag, by default true

bool A boolean indication of success

notify ( )

Send notification to the referenced object

bool A boolean indication of success

offsetExists (   $offset)

{}

offsetGet (   $offset)

{}

offsetSet (   $offset,
  $value 
)

{}

offsetUnset (   $offset)

{}

pop ( )

Pops an item from the objects property table

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.

void The methods return value, if used, will be ignored

shift ( )

Shifts an item from the objects properties table

mixed The first item from the objects properties table

synchronized ( \Closure  $function,
  $args = null 
)

Executes the block while retaining the synchronization lock for the current context.

Parameters
\Closure$functionThe block of code to execute
mixed$args... Variable length list of arguments to use as function arguments to the block

mixed The return value from the block

wait (   $timeout)

Waits for notification from the Stackable

Parameters
int$timeoutAn optional timeout in microseconds

bool A boolean indication of success


The documentation for this class was generated from the following file: