PHP_Fork
[ class tree: PHP_Fork ] [ index: PHP_Fork ] [ all elements ]

File: basic.php

Source Location: /PHP_Fork-0.3.2/examples/basic.php

Classes:

PHP_Fork class. Wrapper around the pcntl_fork() stuff with a API set like Java language.

Page Details:

Includes:

require_once("PHP/Fork.php") [line 22]
PHP_Fork class usage examples ================================================================================== NOTE: In real world you surely want to keep each class into a separate file, then include() it into your application.

For this examples is more useful to keep all_code_into_one_file, so that each example shows a unique feature of the PHP_Fork framework. ================================================================================== basic.php

This is the most basic example I can think about... Simply increment an internal counter every second, printing it to stdout. Repeat this 10 times, then exit. The class extends PHP_Fork, so we have multiple instances running cuncurrently, as shown by the timestamp of each thread.

==================================================================================


Documentation generated on Mon, 11 Mar 2019 15:41:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.