xp_threaded_process

xp_threaded_process($process)

Enables a process to execute within it’s own thread.

Warning

Threaded functionality within XPSPL is highly experiemental...

This has not been tested in a production environment.

Note

To enable threads you must install and enable the PECL pthreads extension.

Once installed threads will be automatically enabled.

Example #1 Basic Usage

Executing processes in their own thread.

<?php

xp_signal(XP_SIG('foo'), threaded_process(function($sig){
    print 'Executed in own thread';
    sleep(10);
});

 :param callable: PHP Callable

 :rtype: void
Read the Docs v: v5.0.1
Versions
latest
v5.0.1
v5.0.0
v4.0.1
v4.0.0
v3.1.1
v3.1.0
v3.0.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.