PHPackages                             sj-i/ffi-zts-parallel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sj-i/ffi-zts-parallel

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

sj-i/ffi-zts-parallel
=====================

PHP-side wrapper around pecl/parallel for use through sj-i/ffi-zts (NTS host -&gt; embedded ZTS interpreter -&gt; real OS threads).

v2.0.0(1mo ago)010[1 PRs](https://github.com/sj-i/ffi-zts-parallel/pulls)MITPHPPHP &gt;=8.5,&lt;8.6CI passing

Since Apr 20Pushed 1mo agoCompare

[ Source](https://github.com/sj-i/ffi-zts-parallel)[ Packagist](https://packagist.org/packages/sj-i/ffi-zts-parallel)[ RSS](/packages/sj-i-ffi-zts-parallel/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (5)Dependencies (4)Versions (13)Used By (0)

ffi-zts-parallel
================

[](#ffi-zts-parallel)

NTS-hosted wrapper around [`pecl/parallel`](https://www.php.net/manual/en/book.parallel.php)that runs through [`sj-i/ffi-zts`](https://github.com/sj-i/ffi-zts).

Gives a plain non-thread-safe PHP CLI access to real OS-thread parallelism via `parallel\Runtime`, without replacing the system PHP build. See [`docs/DESIGN.md`](https://github.com/sj-i/ffi-zts/blob/main/docs/DESIGN.md)in the core package for the full design.

Install
-------

[](#install)

```
composer require sj-i/ffi-zts-parallel
```

Both `sj-i/ffi-zts` and `sj-i/ffi-zts-parallel` ship as **Composer plugins**. On install, each downloads the pre-built binary matching your host's PHP minor / CPU arch / libc:

- `vendor/sj-i/ffi-zts/bin/libphp.so`
- `vendor/sj-i/ffi-zts-parallel/bin/extensions/ffi-zts/parallel.so`

### Trusting the plugins

[](#trusting-the-plugins)

Composer 2.2+ asks you to trust a new plugin before running it. In interactive shells you get a `(y/N)` prompt on first install. In CI / non-interactive environments, whitelist both up front:

```
composer config allow-plugins.sj-i/ffi-zts true
composer config allow-plugins.sj-i/ffi-zts-parallel true
composer require sj-i/ffi-zts-parallel
```

### Manual install / retry

[](#manual-install--retry)

If either plugin was skipped (`--no-plugins`, network outage, binary not yet published for a new PHP minor), retry the binary fetch on demand from the root project:

```
vendor/bin/ffi-zts install   # fetches libphp.so
# parallel.so is re-fetched on the next `composer update sj-i/ffi-zts-parallel`.
```

Usage
-----

[](#usage)

```
