Swoole Get Started

Get Started

Before installing

Environment requirement for installing Swoole.

Class Alias

Class Alias supported by Swoole

Installation Guide

How to install Swoole on your server

Swoole Server

Swoole Server provides the API to write TCP / UDP / UnixSocket Servers.

Swoole HTTP Server

Swoole HTTP Server provides the API to write HTTP servers.

Swoole WebSocket Server

Swoole WebSocket Server provides the API to write WebSocket servers.

Swoole Redis Server

Swoole Redis Server provides the API to write TCP servers with Redis protocol.

Swoole Process Manager

Linux process management module can be used to create new Linux process, manage the processes, and the communication between different processes.

Swoole EventLoop

Developers can use Swoole EventLoop API to use the system EventLoop.

Swoole Scheduler

Schedule functions to run at set intervals, accurate to milliseconds.

Swoole Memory Management

Swoole provides 6 different memory operation APIs: Lock, Buffer, Table, Atomic, MMap, Channel which can be used when developing multiple process programs.

Swoole Atomic

Integer variable allows any processor to atomically test and modify. Implemented based on CPU atomic instructions.

Swoole Buffer

The memory management module enables developers managing memory like C language without worrying about memory allocation, release.

Swoole Table

Swoole table is a high performance memory management module, implemented based on shared memory and spin lock.

Swoole MMap (Depreciation)

Swoole provides the API to use mmap for files access.

Swoole Serialize (Depreciation)

Fast serialization for PHP.

Swoole Coroutine

Concurrency with Swoole Conroutine. Coroutine is the mainstream since Swoole version 4.0, although the async style API is supported by extension ext-async, Coroutine style API is recommended.

Swoole Coroutine Methods
Swoole Coroutine Channel
Swoole Coroutine Scheduler
Swoole Coroutine Client
Swoole Coroutine HTTP Client
Swoole Coroutine HTTP2 Client
Swoole Coroutine Redis Client
Swoole Coroutine MySQL Client
Swoole Coroutine Postgres Client
Swoole Coroutine Socket
Swoole Coroutine Library
Swoole Coroutine Library
Swoole Process Pool

Swoole Async Modules (Depreciation)

Swoole Async is not recommended.

Swoole Async TCP/UDP Client (Depreciation)

Swoole client provides the API to write TCP/UDP/UnixSocket/HTTP clients, supports IPv4/IPv6 protocol. Developers can write sync or async client side features with swoole client API.

Swoole Async File I/O (Depreciation)

Async API includes the async File IO API, Timer, async HTTP client API, async MySQL client API, async Redis client API and async DNS client API.

Swoole Async MySQL Client (Depreciation)

The swoole async MySQL client is a replacement of the other sync MySQL clients: libmysqlclient, mysqlnd, mysqli.

Swoole Async Redis Client (Depreciation)

Swoole async Redis client is based on hiredis.

Swoole Async Http/WebSocket Client (Depreciation)

Swoole Async HTTP client is a high performance and async HTTP client supports Http-Chun, Keep-Alive, form-data.

Swoole Async Http2 Client (Depreciation)

Http2.0 client support stream and multiplexing. Multiple GET or POST request can be sent over the same TCP connection.

Swoole Async Channel (Depreciation)

Memory data structure likes Chan in Golang, implemented based on shared memory and Mutex locks. It can be used as high-performance message queue in memory.

Swoole Async Lock (Depreciation)

Swoole locks enable PHP developers to use locks for data synchronisation between multiple threads or processes.