Swoole Features


  • Rapid development of high performance protocol servers & clients with PHP language
  • Event-driven, asynchronous programming for PHP
  • Both Coroutine and callback style asynchronous
  • Event loop API
  • Processes management API
  • Memory management API
  • Async TCP/UDP/HTTP/WebSocket/HTTP2 client/server side API
  • Async TCP/UDP client side API
  • Async MySQL client side API and connection pool
  • Async Redis client/server side API
  • Async DNS client side API
  • Message Queue API
  • Async Task API
  • Milliseconds scheduler
  • Async File I/O API
  • Golang style channels for inter-processes communication
  • System locks API: Filelock, Readwrite lock, semaphore, Mutex, spinlock
  • IPv4/IPv6/UnixSocket/TCP/UDP and SSL/TLS support
  • Fast serializer/unserializer

Use cases

  • Web applications and systems
  • Mobile communication systems
  • Online game systems
  • Internet of things
  • Car networking
  • Smart home systems

Swoole framework is open source and free. Released under the license of Apache 2.0.

Major change since version 4.3.0

Async clients and API are moved to a separate PHP extension swoole_async since version 4.3.0, install swoole_async:

# install swoole extension
git clone https://github.com/swoole/swoole-src
cd swoole-src/
make -j 4
sudo make install

# install async extension
git clone https://github.com/swoole/ext-async.git
cd ext-async
make -j 4
sudo make install

Enable it by adding a new line extension=swoole_async.so to php.ini.