All Projects → amphp → Amp

amphp / Amp

Licence: mit
A non-blocking concurrency framework for PHP applications. 🐘

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Amp

Swiftcoroutine
Swift coroutines for iOS, macOS and Linux.
Stars: ✭ 690 (-80.04%)
Mutual labels:  async, coroutines, promises
Minicoro
Single header asymmetric stackful cross-platform coroutine library in pure C.
Stars: ✭ 164 (-95.26%)
Mutual labels:  async, coroutines
Service Bus
PHP Service Bus (publish-subscribe pattern) implementation
Stars: ✭ 290 (-91.61%)
Mutual labels:  async, amphp
Byte Stream
A non-blocking stream abstraction for PHP based on Amp.
Stars: ✭ 208 (-93.98%)
Mutual labels:  async, amphp
Tascalate Concurrent
Implementation of blocking (IO-Bound) cancellable java.util.concurrent.CompletionStage and related extensions to java.util.concurrent.ExecutorService-s
Stars: ✭ 144 (-95.83%)
Mutual labels:  async, promises
Hydra
⚡️ Lightweight full-featured Promises, Async & Await Library in Swift
Stars: ✭ 1,954 (-43.48%)
Mutual labels:  async, promises
Fooproxy
稳健高效的评分制-针对性- IP代理池 + API服务,可以自己插入采集器进行代理IP的爬取,针对你的爬虫的一个或多个目标网站分别生成有效的IP代理数据库,支持MongoDB 4.0 使用 Python3.7(Scored IP proxy pool ,customise proxy data crawler can be added anytime)
Stars: ✭ 195 (-94.36%)
Mutual labels:  async, coroutines
Cppcoro
A library of C++ coroutine abstractions for the coroutines TS
Stars: ✭ 2,118 (-38.73%)
Mutual labels:  async, coroutines
Mysql
Async MySQL client for PHP based on Amp.
Stars: ✭ 235 (-93.2%)
Mutual labels:  async, amphp
React Coroutine
Make your async components compact and descriptive by leveraging the power of the language features
Stars: ✭ 246 (-92.88%)
Mutual labels:  async, coroutines
ProtoPromise
Robust and efficient library for management of asynchronous operations in C#/.Net.
Stars: ✭ 20 (-99.42%)
Mutual labels:  promises, coroutines
Unityfx.async
Asynchronous operations (promises) for Unity3d.
Stars: ✭ 143 (-95.86%)
Mutual labels:  async, coroutines
Asynquence
Asynchronous flow control (promises, generators, observables, CSP, etc)
Stars: ✭ 1,737 (-49.75%)
Mutual labels:  async, promises
Exploring Async
An essay exploring different async techniques in JavaScript.
Stars: ✭ 280 (-91.9%)
Mutual labels:  async, promises
Functional Promises
Write code like a story w/ a powerful Fluent (function chaining) API
Stars: ✭ 141 (-95.92%)
Mutual labels:  async, promises
Redux Promise Middleware
Enables simple, yet robust handling of async action creators in Redux
Stars: ✭ 2,001 (-42.12%)
Mutual labels:  async, promises
Promise Pool
Map-like, concurrent promise processing
Stars: ✭ 258 (-92.54%)
Mutual labels:  async, promises
Tina
Tina is a teeny tiny, header only, coroutine and job library.
Stars: ✭ 125 (-96.38%)
Mutual labels:  async, coroutines
Mioco
[no longer maintained] Scalable, coroutine-based, fibers/green-threads for Rust. (aka MIO COroutines).
Stars: ✭ 125 (-96.38%)
Mutual labels:  async, coroutines
Vertx Lang Kotlin
Vert.x for Kotlin
Stars: ✭ 215 (-93.78%)
Mutual labels:  async, coroutines
Amp Logo

Amp

Amp is a non-blocking concurrency framework for PHP. It provides an event loop, promises and streams as a base for asynchronous programming.

Promises in combination with generators are used to build coroutines, which allow writing asynchronous code just like synchronous code, without any callbacks.

Motivation

Traditionally, PHP has a synchronous execution flow, doing one thing at a time. If you query a database, you send the query and wait for the response from the database server in a blocking manner. Once you have the response, you can start doing the next thing.

Instead of sitting there and doing nothing while waiting, we could already send the next database query, or do an HTTP call to an API.

Making use of the time we usually spend on waiting for I/O can speed up the total execution time. The following diagram shows the execution flow with dependencies between the different tasks, once executed sequentially and once concurrently.

Amp allows such concurrent I/O operations while keeping the cognitive load low by avoiding callbacks. Instead, the results of asynchronous operations can be awaited using yield resulting in code which is structured like traditional blocking I/O code while the actual execution flow is handled by Amp.

Installation

This package can be installed as a Composer dependency.

composer require amphp/amp

This installs the basic building blocks for asynchronous applications in PHP. We offer a lot of repositories building on top of this repository, e.g.

Documentation

Documentation can be found on amphp.org as well as in the ./docs directory. Each packages has it's own ./docs directory.

Requirements

This package requires PHP 7.0 or later. Many of the other packages raised their requirement to PHP 7.1. No extensions required!

Optional Extensions

Extensions are only needed if your app necessitates a high numbers of concurrent socket connections, usually this limit is configured up to 1024 file descriptors.

Examples

Examples can be found in the ./examples directory of this repository as well as in the ./examples directory of our other libraries.

Versioning

amphp/amp follows the semver semantic versioning specification like all other amphp packages.

2.x

Supported. We don't have plans to release v3, yet.

1.x

No longer supported. We stopped providing bug fixes 2017-12-31 and stopped providing security fixes 2018-12-31.

Compatible Packages

Compatible packages should use the amphp topic on GitHub.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].