PHP Class Icicle\Concurrent\Forking\Fork

Inheritance: implements Icicle\Concurrent\Sync\ChannelInterface, implements Icicle\Concurrent\ProcessInterface
Afficher le fichier Open project: icicleio/concurrent Class Usage Examples

Méthodes publiques

Méthode Description
__clone ( )
__construct ( callable $function, $args )
__destruct ( )
enabled ( ) : boolean Checks if forking is enabled.
getPid ( ) : integer Gets the forked process's process ID.
getPriority ( ) : float Gets the fork's scheduling priority as a percentage.
isRunning ( ) : boolean Checks if the context is running.
join ( ) : Generator
kill ( )
receive ( ) : Generator
send ( $data ) : Generator
setPriority ( float $priority ) : float Sets the fork's scheduling priority as a percentage.
signal ( integer $signo )
spawn ( callable $function, $args ) : self Spawns a new forked process and runs it.
start ( ) Starts the context execution.

Private Methods

Méthode Description
execute ( Channel $channel ) : Generator

Method Details

__clone() public méthode

public __clone ( )

__construct() public méthode

public __construct ( callable $function, $args )
$function callable

__destruct() public méthode

public __destruct ( )

enabled() public static méthode

Checks if forking is enabled.
public static enabled ( ) : boolean
Résultat boolean True if forking is enabled, otherwise false.

getPid() public méthode

Gets the forked process's process ID.
public getPid ( ) : integer
Résultat integer The process ID.

getPriority() public méthode

The priority is a float between 0 and 1 that indicates the relative priority for the forked process, where 0 is very low priority, 1 is very high priority, and 0.5 is considered a "normal" priority. The value is based on the forked process's "nice" value. The priority affects the operating system's scheduling of processes. How much the priority actually affects the amount of CPU time the process gets is ultimately system-specific.
See also: Fork::setPriority()
See also: http://linux.die.net/man/2/getpriority
public getPriority ( ) : float
Résultat float A priority value between 0 and 1.

isRunning() public méthode

Checks if the context is running.
public isRunning ( ) : boolean
Résultat boolean True if the context is running, otherwise false.

join() public méthode

public join ( ) : Generator
Résultat Generator

kill() public méthode

public kill ( )

receive() public méthode

public receive ( ) : Generator
Résultat Generator

send() public méthode

public send ( $data ) : Generator
Résultat Generator

setPriority() public méthode

Note that on many systems, only the superuser can increase the priority of a process.
See also: Fork::getPriority()
public setPriority ( float $priority ) : float
$priority float A priority value between 0 and 1.
Résultat float

signal() public méthode

public signal ( integer $signo )
$signo integer

spawn() public static méthode

Spawns a new forked process and runs it.
public static spawn ( callable $function, $args ) : self
$function callable A callable to invoke in the process.
Résultat self The process object that was spawned.

start() public méthode

Starts the context execution.
public start ( )