2017 © Pedro Peláez
 

library thread

AzaThread - Anizoptera CMF simple and powerful threads emulation component for PHP (based on forks).

image

aza/thread

AzaThread - Anizoptera CMF simple and powerful threads emulation component for PHP (based on forks).

  • Tuesday, May 28, 2013
  • by amal
  • Repository
  • 6 Watchers
  • 74 Stars
  • 10,320 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 13 Forks
  • 3 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

AzaThread

Simple and powerful threads emulation component for PHP (based on forks). Old name - CThread., (*1)

https://github.com/Anizoptera/AzaThread, (*2)

![Build Status][TravisImage], (*3)

Table of Contents

  1. Introduction
  2. Requirements
  3. Installation
  4. Documentation and examples
  5. Tests
  6. Credits
  7. License
  8. Links

Introduction

Features:, (*4)

  • Uses forks to operate asynchronously;
  • Supports synchronous compatibility mode if there are no required extensions;
  • Reuse of the child processes;
  • Full exchange of data between processes. Sending arguments, receiving results;
  • Transfer of events between the "thread" and the parent process;
  • Working with a thread pool with preservation of multiple use, passing arguments and receiving results;
  • Uses libevent with socket pairs for efficient inter-process communication;
  • Supports two variants of data serialization for transfer (igbinary, native php serialization);
  • Errors handling;
  • Timeouts for work, child process waiting, initialization;
  • Maximum performance and customization;

Requirements

  • PHP 5.3.3 (or later);
  • Unix system;
  • libevent;
  • pcntl;
  • posix;
  • AzaLibevent - will be installed automatically with composer;
  • AzaSocket - will be installed automatically with composer;
  • AzaCliBase - will be installed automatically with composer;

NOTE: You can use synchronous compatibility mode even without requirements (or on windows, for example)., (*5)

Installation

The recommended way to install AzaThread is through composer. You can see package information on Packagist., (*6)

{
    "require": {
        "aza/thread": "~1.0"
    }
}

Documentation and examples

See full documentation and main examples. Documentation is available in several languages​​!, (*7)

Other examples can be seen in the file examples/example.php and in unit test Tests/ThreadTest.php., (*8)

You can also run the performance tests, choose the number of threads and pick the best settings for your system configuration by using examples/speed_test.php., (*9)

Tests

Tests are in the Tests folder. To run them, you need PHPUnit. Example:, (*10)

$ phpunit --configuration phpunit.xml.dist

Credits

AzaThread is a part of Anizoptera CMF, written by Amal Samally (amal.samally at gmail.com) and AzaGroup team., (*11)

License

Released under the MIT license., (*12)

The Versions

28/05 2013

dev-master

9999999-dev https://github.com/Anizoptera/AzaThread

AzaThread - Anizoptera CMF simple and powerful threads emulation component for PHP (based on forks).

  Sources   Download

MIT

The Requires

 

by AzaGroup Members

serialization async thread daemon parallel fork multi-thread

28/05 2013

v1.1

1.1.0.0 https://github.com/Anizoptera/AzaThread

AzaThread - Anizoptera CMF simple and powerful threads emulation component for PHP (based on forks).

  Sources   Download

MIT

The Requires

 

by AzaGroup Members

serialization async thread daemon parallel fork multi-thread

28/02 2013

v1.0

1.0.0.0 https://github.com/Anizoptera/AzaThread

AzaThread - Anizoptera CMF simple and powerful threads emulation component for PHP (based on forks).

  Sources   Download

MIT

The Requires

 

by AzaGroup Members

serialization async thread daemon parallel fork multi-thread