async
Easily run code asynchronously (by spatie)
parallel
A succinct parallel concurrency API for PHP8 (by krakjoe)
async | parallel | |
---|---|---|
8 | 11 | |
2,537 | 1,380 | |
0.6% | - | |
5.9 | 0.0 | |
3 months ago | 7 days ago | |
PHP | C | |
MIT License | GNU General Public License v3.0 or later |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
async
Posts with mentions or reviews of async.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-01-17.
-
PHP in 2023 - stitcher.io
I really wanna get into writing more asynchronous PHP but having to switch to a whole different web server and execution mode is a major stumbling block. The only library (that I know of) that allows asynchronous code in traditional PHP environment is this one by Spatie.
-
Is it possible that PHP will ever get async/await functions?
You can leverage https://github.com/amphp/parallel or https://github.com/spatie/async without changing the app much.
-
Handling big API request (2.5gb) without timeout
To handle this problem i've used "https://github.com/halaxa/json-machine" to decrease the memory usage and "https://github.com/spatie/async" to decrease the take taken for the "update process" to complete
-
I Avoid Async/Await
It drove me crazy too, until I needed to use Puppeteer which requires you to write async/await (there are Puppeteer implementations in other languages, but they all seem to make compromises I didn't want). Generally speaking, async/await allows you to write code that looks and feels serial. Perhaps try using one of the async libraries for PHP to wrap your mind around the concept of async/await (like https://github.com/spatie/async)
-
Speeding up SSL checking process
Try using spatie's async package and run a chunk of 10 tests in each batch, if that works it might cut your waiting time by quite a lot.
-
Differences among Asynchronous PHP libraries: ReactPHP | amphp | Parallel (pThreads) | Swoole | Fibers | Spatie
Spatie
- What is best and easiest library (packagist) for async process in PHP?
- A pattern for promises in Laravel?
parallel
Posts with mentions or reviews of parallel.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-03-08.
-
Processing One Billion Rows in PHP!
Yes, we can! So far my approach was single threaded, which is the nature of most PHP software, but PHP does support threads in user land through the parallel extension.
-
Multi-threaded code via PHP-FPM
1- You can play around with the pcntl extension or any wrapper library like parallel. I'd say this also adds unnecessary complexity.
- Ask HN: Anyone still using PHP to build side projects or webapps
-
Convert php bot to py or js
Hello everything is fine? I need to use this bot, it works normally in php, but I can't get it to run because I need to compile php with the parallel library https://github.com/krakjoe/parallel. The bot, when giving the command, it checks in the api if the member belongs to the guild mentioned in the code and assigns it the correct role.
-
Parallel requires ZTS
Hello, I'm trying to install a dependency (https://github.com/krakjoe/parallel). it asks you to install ZTS, so from what I've researched on the internet it has to do with the "Xdebug" extension. I did the installation and configured the php.ini. But when I try to give the command "./configure --enable-parallel", I get this error:
- Weekly "ask anything" thread
- Elixir/Erlang VM Concurrency in PHP
-
Differences among Asynchronous PHP libraries: ReactPHP | amphp | Parallel (pThreads) | Swoole | Fibers | Spatie
Parallel [pThreads successor] (comes as extension too)
-
Parallel for 8
Take a look here: https://github.com/krakjoe/parallel/issues/170
-
Are Swoole maintainers lacking confidence in their product? Perspective from a PHP Core maintainer.
The CPU scheduler component for sure cannot be done in user-land, but I also have trouble understanding why it is needed, as from my understanding the whole point of fibers is to not rely on OS threads, which can be used by using the parallel extension.
What are some alternatives?
When comparing async and parallel you can also consider the following projects:
async-php-8-io-http - True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code. Uses PHP Fibers introduced in PHP 8.1
fork - A lightweight solution for running code concurrently in PHP
symfony-docker - A Docker-based installer and runtime for Symfony. Install: download and `docker compose up`.
Swoole - 🚀 Coroutine-based concurrency library for PHP
react-fiber - ReactPHP + ext-fiber
parallel - An advanced parallelization library for PHP, enabling efficient multitasking, optimizing resource use, and application responsiveness through multiple CPU threads.
React - Event-driven, non-blocking I/O with PHP.
coroutine - Cooperative multitasking using generators. The basics of coroutines, async and await!