Amp\Parallel\Context\Internal\Thread classThread extendsThread

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 functionrun()

Runs the thread code and the initialized function.

kill —public functionkill()

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