Download the PHP package zhgzhg/gphpthread without Composer
On this page you can find all versions of the php package zhgzhg/gphpthread. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zhgzhg/gphpthread
More information about zhgzhg/gphpthread
Files in zhgzhg/gphpthread
Package gphpthread
Short Description Generic PHP Threads library using only pure PHP
License MIT
Homepage https://github.com/zhgzhg/gphpthread
Rated 5.00 based on 1 reviews
Informations about the package gphpthread
GPhpThread - Generic PHP Threads library
A heavy threads library implementation written using only pure PHP. A fully functional component that might come in handy when the host system does not have PHP threads module installed and for some reason it cannot be installed (lack of privileges, legacy system, et cetera).
Features
- OO thread creation and management ideology
- Thread execution control:
- start
- stop
- join - blocking or non-blocking mode
- pause
- resume
- sleep with interruption detection
- Thread priority and niceness control
- Support for thread exit codes
- Critical section for sharing data among the threads or for locking purposes
- reliable containers
- faster, unreliable containers
- Extensible and customizable
- Distributed under MIT license
Requirements/Dependencies
- PHP version 5.3+
- PHP shell execution context
- PHP pcntl
- PHP POSIX
- OS Linux family
How To Use
In essence you need to extend class GPhpThread and implement the abstract method run(). Here is an example:
For more information see the files inside "examples" and "tests" directories. An html documentation is available at zhgzhg.github.io/GPhpThread/
Installation
You can use composer to integrate the library in you project:
php composer.phar require zhgzhg/gphpthread:^1.0.7
Alternatively you can also manually download GPhpThread.php file and place it in your project's directory.
All versions of gphpthread with dependencies
ext-pcntl Version *
ext-posix Version *