Download the PHP package sqonk/phext-detach without Composer

On this page you can find all versions of the php package sqonk/phext-detach. 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 phext-detach

PHEXT Detach

Minimum PHP Version

Detach is a library for running tasks inside of a PHP script in parallel using forked processes. It clones a seperate process (based on the parent) and executes the requested callback.

It is light weight and relies on little more than the PCNTL and APCu PHP extensions plus a minor set of composer packages.

Detach is also minimalist in nature with just a small set of functions and classes to memorise. There is no event system and no architecture to learn, allowing it to fit easily within an existing code structure.

See the examples for a quick start guide.

While the spawned tasks have the ability to return data back to the parent there is also the option of using Channels, a loose implementation of channels from the Go language, which provide a simple way of allowing independent processes to send and receive data between one another.

Channels can also be used as logic gates for controlling the execution of various tasks by forcing them to wait for incoming data where required.

Install

Via Composer

Updating past V1.0

Release 1.1 changes the value returned from both a Channel and a BufferedChannel when they are closed. Previously they would return NULL, now they return the constant CHAN_CLOSED. This was done in order to clearly differentiate between null values intentionally inserted into a channel and channel closure.

Code written previously akin to the following:

Should now be written as follows:

Alternatively, for the purposes of maintaining simpler syntax, you can now use a generator:

Updating from V0.4

Release 0.5+ adjusts the way Dispatcher::map() works so that it automatically builds and starts the TaskMap, returning the result of ->start() on the map object. Its parameters have also been expanded to accept the various TaskMap configuration options directly, in preparation for named parameters in PHP8.

Updating from V0.3

Release 0.4+ is a significant update from previous versions. It will break existing code that was built to use V0.3.

Most notably, the class that was formerly named Channel has been renamed to BufferedChannel and a new Channel class has taken its place. You can read more about both classes below.

Also, later in development, the file-based data storage for transferring data between tasks was switched to APCu, now requiring the extension in addition to PCNTL.

Documentation

API Reference now available.

Examples

Skim through the example code for a quick start guide on the basic concepts.

Credits

Theo Howell

Please see original concept of pnctl Threading by Tudor Barbu @ motanelu/php-thread

License

The MIT License (MIT). Please see License File for more information.


All versions of phext-detach with dependencies

PHP Build Version
Package Version
Requires php Version ^8
ext-pcntl Version *
ext-posix Version *
ext-apcu Version *
sqonk/phext-core Version ^1.1
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 sqonk/phext-detach contains the following files

Loading the files please wait ....