# spatie/async

Easily run code asynchronously

Repository: https://github.com/spatie/async
Canonical: https://ross.abutalabs.com/products/spatie-async
Homepage: https://spatie.be/en/opensource/php
Language: PHP
License: MIT
License Family: permissive
Topics: php, performance, async, await
Last push: 2026-06-02T06:57:46+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 85, release rhythm 45, longevity 100
- inputs: {"age_days": 3184, "days_push": 92, "days_rel": 205, "gap_med": 93.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2815, forks 184 (observed 2026-08-28T04:07:23.820509+00:00)

## What it is
A PHP library providing a small, easy-to-use wrapper around PHP's PCNTL extension for running code in parallel processes. It offers a pool-based API with promise-like then/catch/timeout hooks for managing asynchronous tasks.

## Use cases
- run php tasks in parallel
- execute background processes in php
- speed up batch processing with multiprocessing
- run closures asynchronously in php
- parallelize cpu-bound work in php scripts
- handle process timeouts and errors in parallel php

## When to choose
- you need simple parallel execution in PHP without heavy queue infrastructure
- you're on Linux with PCNTL available and want a lightweight process pool
- you want promise-style success/error/timeout handling for child processes

## When to avoid
- you're on Windows or shared hosting without PCNTL
- you need distributed or persistent background job queues (use a message queue instead)
- you need true async I/O within a single thread rather than multiprocessing

## Facets
- artifact type: library
- maturity: active
- function: concurrency, developer-tools
- domain: developer-tools, performance, backend
- platform: php, cli
- tags: parallel-processing, pcntl, process-pool, async-php, linux

## Member repositories
- spatie/async (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:23.820509+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:13:28.218102+00:00, confidence not recorded.
  - readme: https://github.com/spatie/async (fetched 2026-08-28T04:07:23.820509+00:00, sha fb9e58036509)
  - homepage: https://spatie.be/en/opensource/php (fetched 2026-08-29T09:53:54.474922+00:00, sha 4a0ae7f7c9b6)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T09:53:54.484558+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T09:53:54.486476+00:00, sha d3cb88e4b34c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
