Example #1
0
    public function sequence3($command, $name, $pattern, $request_info, $request, $timeout, $priority, $trans_id, $pid)
    {
        echo "messaging sequence3 start php\n";
        assert($request == 'start');
        $test1_id = $this->api->send_async($this->api->prefix() . 'f1', '0');
        list(, $test1_check, $test1_id_check) = $this->api->recv_async(null, $test1_id);
        assert($test1_id_check == $test1_id);
        assert($test1_check == 'done');
        list(, $test2_check, $test2_id_check) = $this->api->send_sync($this->api->prefix() . 'g1', 'prefix_');
        assert($test2_check == 'prefix_suffix');
        echo "messaging sequence3 end php\n";
        $this->api->send_async($this->api->prefix() . 'sequence1', 'start');
        $this->api->return_($command, $name, $pattern, '', 'end', $timeout, $trans_id, $pid);
    }
}
$thread_count = \CloudI\API::thread_count();
assert($thread_count == 1);
$main_thread = new Task(new \CloudI\API(0));
$main_thread->run();
/*
// commented out due to PHP threads not having
// readily available installation packages
$thread_count = \CloudI\API::thread_count();
assert($thread_count >= 1);
    
$threads = array();
for ($i = 0; $i < $thread_count; $i++)
{
    $threads[] = new Task(new \CloudI\API($i));
}
foreach ($threads as $t)