PHP Class Spork\SharedMemory

显示文件 Open project: kriswallsmith/spork

Public Methods

Method Description
__construct ( integer $pid = null, integer $signal = null ) Constructor.
receive ( ) : array Reads all messages from shared memory.
send ( mixed $message, integer $signal = null, integer $pause = 500 ) Writes a message to the shared memory.
signal ( $signal ) Sends a signal to the other process.

Method Details

__construct() public method

Constructor.
public __construct ( integer $pid = null, integer $signal = null )
$pid integer The child process id or null if this is the child
$signal integer The signal to send after writing to shared memory

receive() public method

Reads all messages from shared memory.
public receive ( ) : array
return array An array of messages

send() public method

Writes a message to the shared memory.
public send ( mixed $message, integer $signal = null, integer $pause = 500 )
$message mixed The message to send
$signal integer The signal to send afterward
$pause integer The number of microseconds to pause after signalling

signal() public method

Sends a signal to the other process.
public signal ( $signal )