PHP8.x synchronized shared-memory array that can be used as IPC between two PHP 8.x processes.
This class allows two PHP 8.x processes to communicate using a synchronized shared memory array.
The main PHP process uses this class to launch a separate background PHP process.
A php array is synchronized between the two and allow them to talk to each other the way you want.
It works on Windows and Linux.
I'm too lazy to explain in details right now, but if you encountered the same frustrating issues than me regarding multi-threading and non blocking IPC on PHP 8.x CLI under Windows and Linux, and if the single idea of trying to think about installing the Microsoft PHP for Windows toolchain in the hope of compiling all you need yourself on Windows gives you nausea and instestinal transit issues, you might find this library useful or inspiring ...
- on Windows, the API of the misssing extension
sysvsemis emulated using PHP-Win32-Semaphore which itself requires extensionFFIto bind to the required Win32 API ; popenis used to launch background child PHP process ;- a non blocking synchronizsation mechanism allows them to exchange data through a PHP array ;
- There is one usage example here too : https://github.com/SuperUserNameMan/STB-php-ffi