GithubHelp home page GithubHelp logo

amp's Introduction

AMP: Asynchronous Multiprocessing in PHP

Read the QUICKSTART Guide

AMP parallelizes asynchronous RPC-style function calls to job servers and worker process pools. Its goal is to trivialize distributed PHP processing and failover by eliminating the difficulties of threading and non-blocking semantics. AMP's OS-agnostic functionality is available in both Windows and POSIX environments and requires no additional PHP extensions.

Why?

Existing evented PHP libraries require non-blocking semantics for computational concurrency. However, this is a suboptimal solution to the problem of event-driven concurrency because it enforces the use of non-blocking APIs to accomplish anything. Instead, evented code should have access to the vast synchronous toolkit already available to PHP developers. AMP allows developers to write synchronous functions which are then executed and returned asynchronously. This simple approach makes concurrency and distributed processing a reality for PHP coders of any skill level.

FEATURES

  • Offers a simple API for parallelizing function calls to job servers and worker processes;
  • Supplies a TCP job server for distributed processing in both CLI and web SAPI applications;
  • Allows RPC-style calls to worker processes in languages that aren't PHP via a custom inter-process messaging protocol;

IN DEVELOPMENT

  • A lightweight threaded Dispatcher implementation to parallelize tasks to worker threads using PHP's pthreads extension (as opposed to more heavy-weight worker processes);

PROJECT GOALS

  • Simplify PHP parallelization and concurrency by minimizing threaded/non-blocking semantics;
  • Establish a unified API for multi-processing, multi-threading and distributed processing/failover;
  • Build all components using SOLID, readable and thoroughly-tested code.

INSTALLATION

Git:
$ git clone https://github.com/rdlowrey/Amp.git
$ composer install
Composer:
$ composer require rdlowrey/amp:0.2.*
$ composer install

REQUIREMENTS

  • PHP 5.4+
  • rdlowrey/alert event reactor library (retrieved automatically with $ git clone --recursive)
  • Optional: libevent for faster evented execution and high-volume socket connections

amp's People

Contributors

blackshawk avatar morrisonlevi avatar rdlowrey avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.