Download the PHP package irap/async-query without Composer

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

Async Query

This package was created to make it simple to create asynchronous MySql logic. Using asynchronous database queries can dramatically improve your applications performance by removing all of the wait/idle time spent waiting for the connections to be made and for queries to execute on the database.

Requirements

Connection Pools

Asynchronous queries rely on having their own MySql connection. To prevent developers reaching their databases connection limit, our AsyncQuery object relies on being passed a MysqliConnectionPool object which takes a connection limit as one of its required parameters. This object will provide the asynchronous queries with a connection when one becomes available.

AsyncQuery

The AsyncQuery object takes a callback. It is important to remember that this callback is provided the result of executing the SQL statement it was told to execute. This result can be a mysqli_result object or FALSE if the query failed. It is in this callback where you should put any code that works with the result or should execute when the query is finished.

Example Usage:

Queues

There are three queue objects that I recommend using:

Each of these queues take RunnableInterface objects which are AsynqQuery objects or other queues. This allows you to create any combination that you need. For example, you may have several "task types" that have to be executed in order, however each of these "task types" might consist of several hundred tasks that can be executed in any order. In such a case, you would want to create a ParallelRunnableQueue for each of these task types containing all the parallel tasks and then place those ParallelRunnableQueue objects in a single SerialRunnableQueue object.

Every queue can take an optional callback in its constructor. This callback is executed whenever the queue is emptied. The main reason for this is that it allows the developer to run logic that can only be run when all of the tasks in a group have finished. However, you could use this logic to run some logic that would result in more queries being added to the queue etc.

Queues are not a fixed size, you can use the add method to add to them as and when you like. However, remember that the callback will be invoked each time the queue is depleted.

Queues, like the AsyncQuery object, do nothing on their own. The developer needs to execute their run() method for them to execute their queries. The run() method will return true if the query/queue completed/depleted.

Example Usage:

Automated Tests

From 2.0.0 and onwards automated testing has been introduced. Simply go to the testing directory, rename the Settings.php.tmpl to Settings.php and fill in your database details. Then execute the main.php script. All code contributions 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 async-query with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
irap/queues Version 1.0.*
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/async-query contains the following files

Loading the files please wait ....