Download the PHP package kmuenkel/parallel-collection without Composer

On this page you can find all versions of the php package kmuenkel/parallel-collection. 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 parallel-collection

ParallelCollection

A Laravel wrapper for amphp/amp offering a Collection Macro that performs parallel processing.

There is a similar package called spatie/laravel-collection-macros that attempts this, but falls short when the parallel Closure attempts to leverage Laravel abstractions or Model instances. The problem is that, similar to isolated PhpUnit tests, the App needs to be reinitialized when the Closure is underialized for execution. Additionally, serializing and unserializing Model classes is not a straight-forward process, because there are database connections that need to be reestablished. Laravel has already solved this problem though, in the context of serializing Closures for Queued Jobs. So both issues are answerable using existing traits from the framework.

Note that although AmPhp this offers true parallel processing, the parent thread still needs to wait for all children to resolve before closing out. Similar to forking, this seems to be a limitation of Php itself, that if a child task is permitted to resolve after the parent closes, either the parent will attempt to terminate the child prematurely, or the child thread will never be instructed to release its resources after it's done executing, resulting in a zombie process. If the intent is to fire a process intended to resolve later and not make the parent wait around for it, you'll still have to use something like a Queued Job. However, a combination of a queuing and this parallel processor can get the best of both worlds and be extremely performant.

Usage

Parallel Closures

If the items to be handled in parallel are themselves closures, no special treatment is needed.

Parallel items with handler

If your items are not closures, but instead need one to act on them, the example would look like this:


All versions of parallel-collection with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
laravel/framework Version >=8.0
amphp/parallel-functions Version ^1.1
opis/closure Version ^3.6
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 kmuenkel/parallel-collection contains the following files

Loading the files please wait ....