Download the PHP package alicemajere/wonderland-thread without Composer

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

Build Status Scrutinizer Code Quality Code Coverage Code Intelligence Status License

Wonderland Thread

A small simple multi-threading library to include in projects

Recent Update

The project just got released on packagist with release 1.0.0.

Installation

You need to have composer and autloader installed. To be able to install the package, add this entry in the "repositories" index of your composer.json

Just require the package with composer

Usage

To start a multi-threading Pool, just create a new instance of ThreadPool

We setup a maximum number of Thread to run at the same time. If we add 200 Threads to the Pool, only 5 of them will run at the same time until the Pool processed all the 200 Threads

Add one or more Thread to the Pool by creating a new instance of Thread. A Thread take two parameters, a name and a closure function that will tell the Thread what to do. The closure have to return an exit status from the ones defined in the Thread class constants.

To run the ThreadPool, you can just do

You can add Listeners that will trigger on a particular Event while the Pool is running the Threads. Using Listeners can be useful if you need to do particular things for every Threads, like opening a separate mysql connection for every Thread. A Listener object constructor need the Event name to listen to and a closure function that will tell the Listener what to do for this Event. The full list of Event definition is found in the Event class.

Prerequisites

PHP >= 7.2

Getting help

If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!

Authors


All versions of wonderland-thread with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-pcntl Version *
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 alicemajere/wonderland-thread contains the following files

Loading the files please wait ....