{"repo":"Thavarshan/matrix","free":true,"listed":false,"github":"https://github.com/Thavarshan/matrix","clone":"git clone https://github.com/Thavarshan/matrix.git","description":"⚛︎ Bringing JavaScript-style async to PHP! Manage asynchronous tasks with ease using a modern, fiber-powered API for seamless concurrency and error handling.","language":"PHP","stars":60,"topics":["async","fiber","javascript","matrix","non-blocking","php","task"],"license":"MIT","category":"chat-messaging","readme_excerpt":"Matrix Matrix provides small, event-driven async helpers for ReactPHP. It makes promise composition, concurrency limits, retries, timeouts, cancellation, and rate limiting consistent without pretending to create threads or process-level parallelism. Requirements - PHP 8.3 or newer - react/event-loop 1.6 or newer - react/promise 3.3 or newer No pcntl , posix , or sockets extension is required. Install it with Composer: Core usage Import the helpers explicitly in each file: async() schedules a callable on the ReactPHP loop. The callable must use non-blocking I/O; sleep() , file get contents() , CPU-heavy work, and synchronous database clients still block the loop. await() is a top-level synchronous bridge for CLI scripts and other code that owns the loop. It must not be called from inside an already-running loop callback. Use promise chaining inside an event-driven application instead. Composition and concurrency All combinators accept promises or plain values. all() , race() , and any() accept any iterable. all() preserves keys: map() accepts arrays or generators, preserves keys, and limits active work when $concurrency is greater than zero. pool() does the same for zero-argument task callables. Both stop scheduling new work after the first failure and observe already-running tasks. batch() groups values in encounter order and flattens each batch result into a list. waterfall() passes each result to the next callable. Timeouts, retries, and cancellation Timeouts cancel the los","default_branch":null,"files":null,"tree":[],"storefront":"/r/Thavarshan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Thavarshan/matrix/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}