Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Swoole\ChannelSwoole\Channel::__destruct>
^Swoole\ChannelLast updated: Mon, 26 Oct 2026

Swoole\Channel::__construct

(PECL swoole >= 1.9.0)

Swoole\Channel::__construct — Construct a Swoole Channel

Description

public function Swoole\Channel::__construct(string $size)

Swoole channel is memory data structure works like Chan in Golang, implemented based on shared memory and mutex locks. It can be used as high performance message queue in memory. Construct a swoole channel with a fixed size. The minimum size of a swoole channel is 64KB. Exceptions will be thrown if there is not enough memory.

Parameters

size

The size of the Swoole channel.


<Swoole\ChannelSwoole\Channel::__destruct>
^Swoole\ChannelLast updated: Mon, 26 Oct 2026