Constants

ABNORMAL_EXIT

ABNORMAL_EXIT = 255

DONE

DONE = "\0"

EXITED

EXITED = "\1"

FAILED

FAILED = "\2"

READY

READY = "\3"

Properties

$_socket

$_socket : 

Type

$_exports

$_exports : 

Type

$_startHooks

$_startHooks : 

Type

$_failureHooks

$_failureHooks : 

Type

$_ppid

$_ppid : 

Type

$_pid

$_pid : 

Type

$_cancelled

$_cancelled : 

Type

$_inspector

$_inspector : 

Type

$_exceptionHandler

$_exceptionHandler : 

Type

Methods

__construct()

__construct(resource  $socket) 

Create a new worker using the given socket for communication.

Parameters

resource $socket

setLocal()

setLocal(array|string  $local,   $value = null) 

Set local variables to be placed in the workers's scope.

Parameters

array|string $local
$value

setStartHooks()

setStartHooks(array  $hooks) 

Set hooks to run inside the worker before it starts looping.

Parameters

array $hooks

setFailureHooks()

setFailureHooks(array  $hooks) 

Set hooks to run inside the worker after a fatal error is caught.

Parameters

array $hooks

setInspector()

setInspector(object  $inspector) 

Set an Inspector object for Boris to output return values with.

Parameters

object $inspector

any object the responds to inspect($v)

start()

start() 

Start the worker.

This method never returns.

cancelOperation()

cancelOperation() 

While a child process is running, terminate it immediately.

delegateExceptionHandler()

delegateExceptionHandler(  $ex) 

If any user-defined exception handler is present, call it, but be sure to exit correctly.

Parameters

$ex

_runHooks()

_runHooks(  $hooks) 

Parameters

$hooks

_expungeOldWorker()

_expungeOldWorker() 

_write()

_write(  $socket,   $data) 

Parameters

$socket
$data

_read()

_read(  $socket) 

Parameters

$socket

_select()

_select(  $read,   $except) 

Parameters

$read
$except

_transform()

_transform(  $input) 

Parameters

$input