Download the PHP package benmorel/parallel without Composer

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

[!NOTE]
This repository has been archived. Please refer to benmorel/every as a replacement candidate.

Parallel

A command-line script to run commands in parallel at a fixed rate.

Latest Stable Version License

What is it?

Ever needed to execute a command n times per second, allowing these commands to run simultaneously if the first command has not finished executing when the second is started? This tool does just that.

As a safeguard, you must specify the maximum number of processes allowed to run simultaneously. If the commands take too long to execute, and the maximum number of processes is reached, the next execution(s) will be skipped until a slot becomes available.

When is it useful?

Let's say you have a script that queries a remote API. Your request limit on this API is 5 requests per second.

You can't just keep 5 instances of the script running in parallel:

Parallel.phar can start 5 instances of your script every second, regardless of how many are already running, up to a limit specified by you. This limit is necessary to avoid server & network congestion in case of sudden network issue, slowdown or lock.

How to use it?

Ensure that you have PHP installed, and download parallel.phar:

wget https://raw.githubusercontent.com/BenMorel/parallel/0.1.3/bin/parallel.phar
chmod +x parallel.phar

Alternatively, you can install it with Composer.

Then run:

./parallel.phar Rate Concurrency Command [...]

Where:

Example:

./parallel.phar 10 20 date "+%X %N"

This would output 10 lines per second, such as:

04:27:12 PM 031273903
04:27:12 PM 121497348
04:27:12 PM 221800224
04:27:12 PM 322584008
04:27:12 PM 423034796
...

In this example, there cannot be more than 20 processes running in parallel; this is irrelevant for our date example as the execution is really fast, but would be important for long-running scripts, potentially invoking a remote API.

To stop, just press Ctrl + C.


All versions of parallel with dependencies

PHP Build Version
Package Version
Requires symfony/process Version ^5.4
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 benmorel/parallel contains the following files

Loading the files please wait ....