Download the PHP package nunomaduro/pokio without Composer

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

Caution: This package is a work in progress and it manipulates process lifecycles using low-level and potentially unsafe techniques such as FFI for inter-process communication, and preserving state across process spawns. It is intended strictly for internal use (e.g., performance optimizations in Pest). Don't use this in production or use at your own risk—no guarantees are provided.

Pokio

Build Status Total Downloads Latest Stable Version License

Pokio is a dead simple Asynchronous API for PHP that just works! Here is an example:

Behind-the-scenes, Pokio uses the PCNTL extension to fork the current process and run the given closure in a child process. This allows you to run multiple tasks concurrently, without blocking the main process.

Also, for communication between the parent and child processes, Pokio uses FFI to create a shared memory segment, which allows you to share data between processes fast and efficiently.

However, unlike other libraries, if PCNTL or FFI are not available, Pokio will automatically fall back to sequential execution, so you can still use it without any issues.

Installation

Requires PHP 8.3+.

⚡️ Get started by requiring the package using Composer:

Usage

The async global function returns a promise that will eventually resolve the value returned by the given closure.

Similar to other promise libraries, Pokio allows you to chain methods to the promise (like then, catch, etc.).

The then method will be called when the promise resolves successfully. It accepts a closure that will receive the resolved value as its first argument.

Optionally, you may chain a catch method to the promise, which will be called if the given closure throws an exception.

If you don't want to use the catch method, you can also use native try/catch block.

Similar to the catch method, you may also chain a finally method to the promise, which will be called regardless of whether the promise resolves successfully or throws an exception.

If you return a promise from the closure, it will be awaited automatically.

The await global function will block the current process until the given promise resolves.

You may also pass an array of promises to the await function, which will be awaited simultaneously.

Instead of using the await function, you can also invoke the promise directly, which will return the resolved value of the promise.

Follow Nuno

License

Pokio was created by Nuno Maduro under the MIT license.


All versions of pokio with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3.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 nunomaduro/pokio contains the following files

Loading the files please wait ....