PHP Класс Icicle\Concurrent\Threading\Thread

The thread context is not itself threaded. A local instance of the context is maintained both in the context that creates the thread and in the thread itself.
Наследование: implements Icicle\Concurrent\Strand
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__clone ( ) Returns the thread to the condition before starting. The new thread can be started and run independently of the first thread.
__construct ( callable $function, $args ) Creates a new thread.
__destruct ( ) Kills the thread if it is still running.
enabled ( ) : boolean Checks if threading is enabled.
isRunning ( ) : boolean Checks if the context is running.
join ( ) : Generator
kill ( ) Immediately kills the context.
receive ( ) : Generator
send ( $data ) : Generator
spawn ( callable $function, $args ) : Thread Spawns a new thread and runs it.
start ( ) Spawns the thread and begins the thread's execution.

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

Метод Описание
close ( ) Closes channel and socket if still open.

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

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

Returns the thread to the condition before starting. The new thread can be started and run independently of the first thread.
public __clone ( )

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

Creates a new thread.
public __construct ( callable $function, $args )
$function callable The callable to invoke in the thread when run.

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

Kills the thread if it is still running.
public __destruct ( )

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

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

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() публичный Метод

Immediately kills the context.
public kill ( )

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

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

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

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

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

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

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

Spawns the thread and begins the thread's execution.
public start ( )