PHPackages                             async-request/async-request - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. async-request/async-request

ActiveLibrary

async-request/async-request
===========================

Asynchronous cURL library for PHP with reasonable API

v1.0.0(9y ago)2465.1k↑10.3%5[1 PRs](https://github.com/MartinMajor/async-request/pulls)MITPHPPHP &gt;=7.1.0

Since Oct 29Pushed 5y ago4 watchersCompare

[ Source](https://github.com/MartinMajor/async-request)[ Packagist](https://packagist.org/packages/async-request/async-request)[ RSS](/packages/async-request-async-request/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

AsyncRequest
============

[](#asyncrequest)

> Asynchronous cURL library for PHP with reasonable API.

[![Build Status](https://camo.githubusercontent.com/6fc3f251814a3db6a9cf3b5d5d98ee8dcf9b0ebc118b9fe7129574fae669c100/68747470733a2f2f7472617669732d63692e6f72672f4d617274696e4d616a6f722f6173796e632d726571756573742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/MartinMajor/async-request)[![Latest stable](https://camo.githubusercontent.com/6884c1a3bf56fecc72bb2b14862c4d66db5c1d5be8c27661d5ee3311e9b01be5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6173796e632d726571756573742f6173796e632d726571756573742e737667)](https://packagist.org/packages/async-request/async-request)[![License](https://camo.githubusercontent.com/20901bc0eb8b788a7ddff131e4f01e82e851a1ef7b62b84b29b5c7c001ff0a1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6173796e632d726571756573742f6173796e632d726571756573742e737667)](https://camo.githubusercontent.com/20901bc0eb8b788a7ddff131e4f01e82e851a1ef7b62b84b29b5c7c001ff0a1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6173796e632d726571756573742f6173796e632d726571756573742e737667)

PHP is by default single-thread language but when it comes to HTTP requests it is not very convenient to do them in serial. cURL implementation in PHP offers functions for multi requests but with terrible C-style API. This library wraps those functions into modern object-oriented event-driven API.

Requirements
------------

[](#requirements)

async-request/async-request version 1.x requires PHP 7.1+ with cUrl extension enabled.

If you are using PHP5.4+ you can use async-request/async-request version 0.x.

Installation
------------

[](#installation)

You can easily install the newest version using [Composer](http://getcomposer.org/):

```
composer require async-request/async-request
```

Simple example
--------------

[](#simple-example)

```
$urls = [
	'http://www.example.com',
	'http://www.example.org',
];

$asyncRequest = new AsyncRequest\AsyncRequest();

foreach ($urls as $url) {
	$request = new AsyncRequest\Request($url);
	$asyncRequest->enqueue($request, function(AsyncRequest\Response $response) {
		echo $response->getBody() . "\n";
	});
}

$asyncRequest->run();
```

Advanced features
-----------------

[](#advanced-features)

You can specify number of requests that can run in parallel:

```
$asyncRequest->setParallelLimit(5);
```

You can add other requests in callback function:

```
$callback = function(AsyncRequest\Response $response, AsyncRequest\AsyncRequest $asyncRequest) {
	$asyncRequest->enqueue(new AsyncRequest\Request('http://www.example.com'));
};
```

You can specify priority of each request and requests with higher priority will be called first:

```
$asyncRequest->enqueueWithPriority(10, $request, $callback);
```

If you want to use some cURL options, it is as easy as this:

```
$request = new AsyncRequest\Request($url);
$request->setOption(CURLOPT_POST, true);
```

And if you want some special behavior or some additional data in `Response`, you can always create your own `Request` object by implementing `IRequest` interface.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3488d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.1.0

v0.1.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3585c9d277a40bedbf7afe93cbc9a6ef03a77a3aa7a2e0c64e8e3b44859c632b?d=identicon)[MartinMajor](/maintainers/MartinMajor)

---

Top Contributors

[![MartinMajor](https://avatars.githubusercontent.com/u/1373182?v=4)](https://github.com/MartinMajor "MartinMajor (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/async-request-async-request/health.svg)

```
[![Health](https://phpackages.com/badges/async-request-async-request/health.svg)](https://phpackages.com/packages/async-request-async-request)
```

###  Alternatives

[edamov/pushok

PHP client for Apple Push Notification Service (APNs) - Send push notifications to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key) or certificate-based authentication

4093.0M16](/packages/edamov-pushok)[tinify/tinify

PHP client for the Tinify API. Tinify compresses your images intelligently. Read more at https://tinify.com.

2515.2M71](/packages/tinify-tinify)[educoder/pest

A proper REST client for PHP.

358689.2k15](/packages/educoder-pest)[corsinvest/cv4pve-api-php

Corsinvest Proxmox VE Client API PHP

801.4M](/packages/corsinvest-cv4pve-api-php)[pagseguro/pagseguro-php-sdk

Biblioteca de integração com o PagSeguro

312456.6k14](/packages/pagseguro-pagseguro-php-sdk)[chuyskywalker/rolling-curl

Rolling-Curl: A non-blocking, non-dos multi-curl library for PHP

207446.6k6](/packages/chuyskywalker-rolling-curl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
