Open Swoole (previously known as Swoole) is a high-performance platform for asynchronous execution of subprocesses in PHP.
Swoole is installed as an extension for PHP. Currently, Swoole is supported only for Linux and Mac.
It's important to note that Swoole does not work with xDebug, the most popular debugging tool in the PHP ecosystem, and is also poorly compatible with some other profiling and monitoring tools.
For the application to function correctly when launched using this technology, it must be developed with support for asynchronous mode.
In asynchronous mode, the loaded framework configurations, classes, initialized services, and cached data are reused, which significantly accelerates performance.
However, there are distinctive features, such as the need to monitor memory leaks more closely and eliminate blocking operations, and many familiar third-party libraries do not support asynchronous mode.
Storing state in the logical parts of the application becomes undesirable, especially if it is related to a request.
The framework's RollbackInterface is designed for state resetting after each asynchronous request.
For Swoole, you will need to modify the /public/index.php file to ensure the HLEB2 framework runs in a loop. A basic working example:
The Swoole server is started with the console command:
$php ./public/index.php
According to the configuration, the application will be accessible at the address:
http://localhost:9504