Amp\Parallel\Context\Internal\Thread class Thread extends Thread

An internal thread that executes a given function concurrently.

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(resource $socket, callable $function, array $args = [])

Creates a new thread object.

Type Parameter Description Default Value
resource $socket IPC communication socket. none
callable $function The function to execute in the thread. none
array $args Arguments to pass to the function. []
run — public function run()

Runs the thread code and the initialized function.

kill — public function kill()

Sets a local variable to true so the running event loop can check for a kill signal.