Swoole Features

Features

  • Rapid development of high-performance protocol servers & clients with PHP
  • Event-driven, asynchronous programming for PHP
  • Coroutine based concurrent asynchronous IO programming
  • Event Loop API
  • Linux process management
  • In-memory storage and management
  • Coroutine Async TCP/UDP/HTTP/WebSocket/HTTP2 client and server
  • Coroutine Async TCP/UDP client
  • Coroutine Async MySQL client and connection pool
  • Coroutine Async Redis client
  • Coroutine Async DNS client
  • Coroutine Async CURL HTTP client
  • Coroutine Async Postgres client
  • Message Queue API
  • Async Task API
  • Milliseconds scheduler
  • Coroutine Async File I/O API
  • Golang style channels
  • System locks API: Filelock, Readwrite lock, semaphore, Mutex, spinlock
  • IPv4/IPv6/UnixSocket/TCP/UDP and SSL/TLS support
  • Client side connection pool
  • MQTT protocol support
  • FastCGI client and FastCGI proxy

Use cases

  • Web service and system
  • Mobile service and system
  • Online gaming system
  • Internet of things (IoT) system
  • Smart home system
  • Realtime trading system
  • Data processing system

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

Notice for users using version bellow 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/
phpize
./configure
make -j 4
sudo make install

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

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