Download the PHP package logicalsteps/async without Composer
On this page you can find all versions of the php package logicalsteps/async. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download logicalsteps/async
More information about logicalsteps/async
Files in logicalsteps/async
Package async
Short Description async await implementation using generator function in php
License MIT
Homepage https://github.com/logicalsteps/async
Informations about the package async
Async & Await for PHP
Simplify your asynchronous code and make it readable like synchronous code. It works similar to Async and await in other languages such as JavaScript and C#
It can be used standalone with callback functions. It also works with the promise interface of the following frameworks
It can do cooperative multitasking with the event loop interfaces of the following frameworks
Installation
Async can be installed with Composer by adding it as a dependency to your project's composer.json file. It can be done using the following command.
Please refer to Composer's documentation for more detailed installation and usage instructions.
Usage
Consider the following example
If it is all synchronous, our function will simply be
With Async library it can be written as the following
Now the code is clean and looks synchronous, but runs asynchronously for better performance getting us best of both worlds :)
For more examples and integration with the frameworks take a look at examples folder
All versions of async with dependencies
psr/log Version ^1.0 || ^2.0 || ^3.0
ext-json Version *
react/promise Version ^2.8 || ^3.0

