Download the PHP package flytachi/winter-thread without Composer

On this page you can find all versions of the php package flytachi/winter-thread. 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 winter-thread

Winter Thread: A Modern Process Control Library for PHP

Tests Latest Version on Packagist PHP Version Require

Winter Thread is a process engine for PHP: a clean, object-oriented, Java-like API for running and controlling background tasks as isolated OS processes — for parallel and long-running work.

It's an engine — the foundation you build on. A small, dependable core, not a batteries-included framework: the layer your queues, pools, schedulers and workers sit on top of. You bring the higher-level concurrency; the engine handles the hard, boring parts — spawning, signals, isolation, transports.

A Thread here is a process, not a PHP thread. The name is a deliberate nod to a familiar API — just as Python's multiprocessing.Process mirrors its threading interface. Every Thread is one fully isolated OS process wearing a clean, thread-like face (start(), join(), isAlive()) — so there's no shared state to corrupt and nothing to leak between tasks.

No heavy extensions. Unlike pthreads, ext-parallel, or Swoole, it needs no ZTS build and no exotic runtime — just proc_open and the standard POSIX extensions (ext-pcntl, ext-posix) that ship with nearly every PHP install. Each task runs in a fresh, isolated PHP process, so there is no shared state to corrupt and no inherited connections to break.

Key Features

Requirements

Installation

Quick Start

Configuration — the Launcher

Configuration goes through a single Launcher, bound once at bootstrap with Thread::bindLauncher(). When you bind nothing, a self-configuring AdaptiveLauncher is used (AdaptiveLauncher::adaptive()), which routes each launch to the right backend for the current runtime — CliLauncher on CLI / FPM, SwooleLauncher inside a Swoole coroutine.

Swoole / Event-Loop Compatibility

When its transport is left unset, the launcher picks a pipe-free transport (TempFileTransport) if it detects an active Swoole runtime — pipe file descriptors from proc_open do not survive SWOOLE_HOOK_ALL intact.

Launching from inside a Swoole coroutine is supported. A pipe-free transport handles the payload, but the spawn is the other half: native proc_open contends with the reactor over the file-descriptor table from inside a coroutine. The default AdaptiveLauncher closes that gap — it routes to SwooleLauncher, which starts the runner as a shell background job (Coroutine\System::exec()) that never touches the reactor's fds. So in-coroutine dispatch works out of the box; plain CLI and FPM go through proc_open exactly as before. See docs/07.

Transport Delivery Parent pipe fd Requires
PipeTransport stdin pipe (default in CLI) yes
TempFileTransport temp file as stdin none
ShmTransport shared memory none ext-shmop

Detached (zombie-free) fire-and-forget

For a long-lived parent (FPM worker, daemon) that dispatches background tasks and never joins them, pass detached: true. The launcher exits immediately and the real worker is reparented to init (pid 1), so no zombie ever accumulates under the parent:

Signal control still works via the worker's self-reported PID (write getmypid() from inside the task to your own store), since the engine's control model is PID-based.


Output Modes

$outputTarget Use case
'/dev/null' (default) Fire-and-forget: safe, output discarded
'/path/to/file.log' Persistent logging for staging/production
null (explicit) Piped to parent: read via readOutput() / readError()

Note: With null, join() and reap() drain the pipes internally while they wait, so a bare join() never deadlocks on a large output — and readOutput() after it returns the full buffered output. Use an explicit readOutput() poll loop only when you want the output live as it is produced.

Process Control

Running Tests

Tests come in two tiers (mirroring the winter-kernel layout):

Default — runs on any machine; unsupported extensions self-skip:

Containered — heavy, environment-specific checks (leak / timing / nested / battle-run, with Cli / FPM / Swoole), run inside Docker across a list of PHP versions:

CI (.github/workflows/ci.yml) runs the default suite via setup-php and the container suite via the bundled tests/docker/Dockerfile, on a PHP 8.4 / 8.5 matrix.

Documentation

Full documentation lives in /docs:

  1. Introduction — philosophy, the no-heavy-ext story, when to use it
  2. Installation & Requirements
  3. Quickstart — a complete parallel example in 5 minutes
  4. Basic Usage
  5. Output & Debugging
  6. Process Control & Lifecycle — signals, graceful shutdown
  7. The Launcher
  8. Payload Transports
  9. Detached Mode
  10. Security
  11. Architecture & Internals
  12. Patterns — pools, returning results, retries
  13. Troubleshooting
  14. API Reference
  15. Testing

Contributing

Contributions are welcome! Please submit a pull request or open an issue for bugs, questions, or feature requests.

License

This library is open-source software licensed under the MIT license.


All versions of winter-thread with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-pcntl Version *
ext-posix Version *
opis/closure Version ^4.5
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 flytachi/winter-thread contains the following files

Loading the files please wait ...