Download the PHP package bear/async without Composer

On this page you can find all versions of the php package bear/async. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package async

BEAR.Async

Async/parallel resource execution library for BEAR.Sunday

Why BEAR.Async?

BEAR.Async preserves your resource code. You choose an async execution mode at the application boundary — no async/await, no Promise, no yield, no rewrites of existing #[Embed] graphs.

These 3 embeds execute in parallel instead of sequentially.

Installation

Demo and Benchmarks

A runnable demo application lives in demo/. It builds separate Docker images for ext-parallel and ext-swoole, starts MySQL, seeds a dashboard resource graph with 8 independent SQL-backed GET embeds, and exposes Sync, ext-parallel, and Swoole entrypoints.

The demo also includes cold one-shot CLI benchmarks and steady-state HTTP benchmarks with wrk:

See the demo guide for setup details and benchmark results for measured numbers and adapter selection guidance.

Execution Modes

Parallel execution (ext-parallel)

Recommended for typical PHP-FPM / Apache web applications with embedded resources.

Add bin/async.php next to bin/app.php. It hands off to the library bootstrap, which overlays the ext-parallel runtime on the normal AppModule:

Do not install the parallel runtime in AppModule directly. The bootstrap is the only supported install path so the same AppModule works under bin/app.php (sync) and bin/async.php (parallel) unchanged.

To override the worker pool size (default = CPU cores), pass it as the optional 6th argument:

Constraints

Worker Runtimes are separate threads with their own zend memory. Embedded resources executed via this module must satisfy:

Scope

This module targets PHP-FPM / Apache style request-per-process runtimes. For long-running Swoole HTTP Server use AsyncSwooleModule instead — its coroutines share the same process memory and do not have the cross-thread copyability constraint.

Swoole execution (ext-swoole)

For applications already running on Swoole HTTP Server with high concurrency requirements.

ext-parallel uses worker runtimes, so it is selected by a separate entrypoint. ext-swoole runs inside one server process, so it is installed as an application module.

Which execution mode should I use?

Use Case Entrypoint Runtime setup
PHP-FPM / Apache with embedded resources bin/async.php library bootstrap overlay
Swoole HTTP Server bin/swoole.php AsyncSwooleModule (in AppModule)

Comparison

ext-parallel ext-swoole
Concurrency Thread pool (CPU cores) Coroutines (thousands)
Memory Separate per worker Shared (process-level)
PDO handling Isolated per thread Connection pool required
Server PHP-FPM / Apache Swoole HTTP Server
Setup Add bin/async.php Add bin/swoole.php

How It Works

The AsyncLinker replaces the standard Linker to enable parallel execution of resource requests:

  1. Level-by-level execution: Requests are processed level by level
  2. Request deduplication: Same requests are merged and executed only once
  3. Result caching: Results are cached to avoid redundant requests

Documentation

Requirements

PHP 8.2+ for the library itself. Each execution mode adds its own runtime requirement:

Mode Requires Application change
ext-parallel ZTS PHP + ext-parallel add bin/async.php
ext-swoole ext-swoole install AsyncSwooleModule, use bin/swoole.php

SQL Resources with BDR + #[Embed]

To run multiple SQL queries for one page, split each query into its own ResourceObject and let #[Embed] parallelize them via AsyncLinker. Combined with Ray.MediaQuery's BDR pattern (#[DbQuery] interface + factory + immutable domain object), SQL stays in var/sql/*.sql, the call site reads as plain objects, and the resource graph itself is what gets parallelized.

Recipe dependency (not bundled with BEAR.Async):


All versions of async with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
aura/sql Version ^5.0 || ^6.0
bear/app-meta Version ^1.6
bear/package Version ^1.14
bear/resource Version ^1.32
ray/di Version ^2.18
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bear/async contains the following files

Loading the files please wait ...