Channel Distributed Communication Component

(Requires Workerman version >= 3.3.0)

Source code:

Channel is a distributed communication component used for inter-process or inter-server communication.


  1. Based on the publish-subscribe model
  2. Non-blocking IO


Channel consists of Channel/Server as the server end and Channel/Client as the client end.

Channel/Client connects to Channel/Server through the connect interface and maintains a long connection.

Channel/Client informs Channel/Server of which events it is interested in by calling the on interface and registers event callback functions (callbacks occur in the process where Channel/Client is located).

Channel/Client publishes a certain event and its related data to Channel/Server through the publish interface.

After receiving the event and data, Channel/Server distributes them to the Channel/Clients that are interested in this event.

Upon receiving the event and data, Channel/Client triggers the callback set by the on interface.

Channel/Client will only receive events it is interested in and trigger callbacks.


composer require workerman/channel


Channel can only be used in the Workerman environment and cannot be used in the php-fpm environment.