What is Swoole? • A C extension for PHP • An asynchronous network engine for PHP • Features: • Event-driven non-blocking I/O • HTTP / HTTP2 / Websocket / TCP / UDP • Coroutine (CSP Model) • High performance for high concurrency
Structure in Swoole Server • Code Is Persistent in Memory • Swoole Takes Lifecycle Over PHP • Reduce Initialization Steps • Reduce Response Latency • Event-driven Non-blocking I/O for Requests
Use Case Facebook Webhooks Message Load Balancer Server Server Server Queue PubNub Service Analysis Service Swoole Service PubSub Many to Many Queue Workers High Concurrent Requests