PHP Класс Icicle\Concurrent\Forking\Fork

Наследование: implements Icicle\Concurrent\Sync\ChannelInterface, implements Icicle\Concurrent\ProcessInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__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.

Приватные методы

Метод Описание
execute ( Channel $channel ) : Generator

Описание методов

__clone() публичный Метод

public __clone ( )

__construct() публичный Метод

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

__destruct() публичный Метод

public __destruct ( )

enabled() публичный статический Метод

Checks if forking is enabled.
public static enabled ( ) : boolean
Результат boolean True if forking is enabled, otherwise false.

getPid() публичный Метод

Gets the forked process's process ID.
public getPid ( ) : integer
Результат integer The process ID.

getPriority() публичный Метод

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.
См. также: Fork::setPriority()
См. также: http://linux.die.net/man/2/getpriority
public getPriority ( ) : float
Результат float A priority value between 0 and 1.

isRunning() публичный Метод

Checks if the context is running.
public isRunning ( ) : boolean
Результат boolean True if the context is running, otherwise false.

join() публичный Метод

public join ( ) : Generator
Результат Generator

kill() публичный Метод

public kill ( )

receive() публичный Метод

public receive ( ) : Generator
Результат Generator

send() публичный Метод

public send ( $data ) : Generator
Результат Generator

setPriority() публичный Метод

Note that on many systems, only the superuser can increase the priority of a process.
См. также: Fork::getPriority()
public setPriority ( float $priority ) : float
$priority float A priority value between 0 and 1.
Результат float

signal() публичный Метод

public signal ( integer $signo )
$signo integer

spawn() публичный статический Метод

Spawns a new forked process and runs it.
public static spawn ( callable $function, $args ) : self
$function callable A callable to invoke in the process.
Результат self The process object that was spawned.

start() публичный Метод

Starts the context execution.
public start ( )