Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/edenreich/asyncphp

A simple way to make async operations using PHP
https://github.com/edenreich/asyncphp

Last synced: about 4 hours ago
JSON representation

A simple way to make async operations using PHP

Awesome Lists containing this project

README

        

# AsyncPHP

A simple way to make async operations using PHP

# Installation

in the terminal:
```sh
composer require reich/async
```

# Usage

To create a new thread:
```php
$thread = new \AsyncPHP\Thread(function);
```

To join the thread to the main context:
```php
$thread->join();
```

To get the currently running threads:
```php
echo \AsyncPHP\Thread::$count
```

# Note
This can only be used from the command line atm.