Download the PHP package irap/queues without Composer

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

Queues

This package was created to make it simple to create queues of tasks, such as for sending asynchronus MySQL queries or CURL requests.

Requirements

The Queues

SerialRunnableQueue

Run items one after each other (FIFO), waiting for each one to complete before moving onto the next.

ParallelRunnableQueue

Run the items in parallel. These items could be executed/completed in any order. This is where performance benefits are realized.

RunnableStack

Execute items in the same manner as SerialRunnableQueue except that instead of being FIFO, items are executed in reverse order with the last item being added being executed first.

Interfaces

In order to use the queus, the objects you put into them need to implement the RunnableInterface which simply means the objects have a run method that returns true when the task has completed. This method will keep being called by the queue until it returns true. This may seem silly but is necessary for asynchronous requests which may take some time to complete, and thus you need to keep track of the state in the object and return true once you have the result back.

Queues Within Queues

Due to the fact that all of the queues also implement the RunnableInterface, you can create queues of other queues to create any combinations you need. For example, you may have several "tasks" that have to be executed in a certain order, however each of these "tasks" might consist of several hundred "sub-tasks" that can be executed in any order. In such a case, you would want to create a ParallelRunnableQueue to place each group of subtasks into. Then you would place each of these parallel queues into a single SerialRunnableQueue object to make sure the groups get executed in the correct order.

Every queue can take an optional callback in its constructor. This callback is executed whenever the queue is completed/emptied, allowing the developer to run logic only when the queu has finished.

Queues are not a fixed size, you can use the add method to add to them whenever you want, including whilst they are running. However, remember that the queu's callback will be invoked each time the queue is depleted.

Example Usage:

Automated Tests

Simply go to the testing directory and execute the main.php script. All code contributions that add new functionality should provide a relevant test case. It may be a good idea to read through the automated tests to get example usages.


All versions of queues with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
irap/interfaces Version 0.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 irap/queues contains the following files

Loading the files please wait ....