Skip to content

PQ ("peak"), automatically wrap blocking functions in an async child process and turn blocking functions into non-blocking promises, built on top of ReactPHP

License

Notifications You must be signed in to change notification settings

Degra1991/reactphp-pq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

clue/reactphp-pq

PQ ("peak"), automatically wrap blocking functions in an async child process and turn blocking functions into non-blocking promises, built on top of ReactPHP.

Quickstart example

Once installed, you can use the following code turn any blocking function (such as PHP's built-in file_get_contents() function) into a non-blocking one:

$file_get_contents = (new Clue\React\Pq\Executor($loop))->fun('file_get_contents');

$file_get_contents(__FILE__)->then(function (string $contents) {
    echo $contents;
}, function (Exception $e) {
    echo 'Error: ' . $e->getMessage() . PHP_EOL;
});

Install

A clue·access project

This project is currently under active development, you're looking at a temporary placeholder repository.

Do you want early access to my unreleased projects? You can either be patient and wait for general availability or consider becoming a sponsor on GitHub for early access.

Do you sponsor me on GitHub? Thank you for supporting sustainable open-source, you're awesome! The prototype is available here: https://github.com/clue-access/reactphp-pq.

Support open-source and join clue·access ❤️

License

This project will be released under the permissive MIT license.

Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.

About

PQ ("peak"), automatically wrap blocking functions in an async child process and turn blocking functions into non-blocking promises, built on top of ReactPHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published