PHPackages                             drewlabs/async - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. drewlabs/async

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

drewlabs/async
==============

Provides utility function for async programming in PHP

v0.1.6(2y ago)0562MITPHPPHP &gt;=7.2

Since Sep 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/azandrew-sidoine/async)[ Packagist](https://packagist.org/packages/drewlabs/async)[ RSS](/packages/drewlabs-async/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (2)

Async
=====

[](#async)

The `async` library provides a list of utility functions to doing basic async programming in PHP language. It makes use of PHP `Generator` to implement a co-routine platform on top of which async tasks are executed.

Usage
-----

[](#usage)

The library provides the following utility functions:

- async `async(callable $waitFn)`

The `async` utility provides an asynchronous function execution context for the subroutine passed as argument.

It returns a `Awaitable` instance which start the subroutine when `wait()` is invoked on it. The `wait()` statement as it will pause the script execution until the subroutine complete.

```
