Channel

This subclass is used for client-to-client communication over MPD

MphpD::channel(string $name) : Channel

Methods

__construct

This class is not intended for direct usage. Use MphpD::channel() instead to retrieve an instance of this class.

Channel::__construct(FloFaber\MphpD\MphpD $mphpd, string $name) : mixed

Parameters

Returns mixed

subscribe

Subscribe to the channel.

Channel::subscribe() : bool

Parameters

Returns bool

bool true on success or false on failure.

unsubscribe

Unsubscribe the channel.

Channel::unsubscribe() : bool

Parameters

Returns bool

bool true on success or false on failure.

read

Returns a list of the channel's messages.

Channel::read() : mixed

Parameters

Returns mixed

array|false array containing the messages on success or false on failure.

send

Send a message to the channel.

Channel::send(string $message) : bool

Parameters

Returns bool

bool true on success or false on failure.

© 2023 Florian Faber