This is automatic generated document for things in Swow\Channel class

Class Channel

channel transfers information across coroutines

This class is a generic class. Template T

Methods

Method __construct

public function __construct ( int $capacity )

Method __debugInfo

public function __debugInfo ( ) : array<string, mixed>

Returns array<string, mixed> debug information for var_dump

Method close

public function close ( ) : void

Method getCapacity

public function getCapacity ( ) : int

Method getLength

public function getLength ( ) : int

Method hasConsumers

public function hasConsumers ( ) : bool

Method hasProducers

public function hasProducers ( ) : bool

Method isAvailable

public function isAvailable ( ) : bool

Method isEmpty

public function isEmpty ( ) : bool

Method isFull

public function isFull ( ) : bool

Method isReadable

public function isReadable ( ) : bool

Method isWritable

public function isWritable ( ) : bool

Method pop

public function pop ( int $timeout ) : T

pop data from channel

context switching happens here when channel is empty, context switching may also happen at this even channel is not empty.

Param int $timeout in microseconds

Returns T $data

Method push

public function push ( T $data , int $timeout ) : static

push data into channel

context switching happens here when channel is full, context switching may also happen at this even channel is not full.


Copyright 2022 the Swow contributors