Reading and Writing
- public function read() — Read from the channel. A channel defines the format of data that is read from it, so this method may return strings, objects, or anything else.
- public function write($bytes) — Write to the channel. A channel defines what data format it accepts, so this method may take strings, objects, or anything else.
Waiting for Activity
- public static function waitForAny($channels, $options) — Wait for any activity on a list of channels. Convenience wrapper around @{method:waitForActivity}.
- public static function waitForActivity($reads, $writes, $options) — Wait (using select()) for channels to become ready for reads or writes. This method blocks until some channel is ready to be updated.
Responding to Activity
- public function update() — Updates the channel, filling input buffers and flushing output buffers. Returns false if the channel has closed.
Channel Implementation
- public function setName($name) — Set a channel name. This is primarily intended to allow you to debug channel code more easily, by naming channels something meaningful.
- public function getName() — Get the channel name, as set by @{method:setName}.
- abstract public function isOpen() — Test if the channel is open: active, can be read from and written to, etc.
- abstract public function closeWriteChannel() — Close the channel for writing.
- public function isOpenForReading() — Test if the channel is open for reading.
- public function isOpenForWriting() — Test if the channel is open for writing.
- abstract protected function readBytes($length) — Read from the channel's underlying I/O.
- abstract protected function writeBytes($bytes) — Write to the channel's underlying I/O.
- protected function getReadSockets() — Get sockets to select for reading.
- protected function getWriteSockets() — Get sockets to select for writing.
- public function setReadBufferSize($size) — Set the maximum size of the channel's read buffer. Reads will artificially block once the buffer reaches this size until the in-process buffer is consumed.
- public function isReadBufferEmpty() — Test state of the read buffer.
- public function isWriteBufferEmpty() — Test state of the write buffer.
- public function getWriteBufferSize() — Get the number of bytes we're currently waiting to write.
- public function flush() — Wait for any buffered writes to complete. This is a blocking call. When the call returns, the write buffer will be empty.
Other Methods
- public function __get($name)
- public function __set($name, $value)
- public function current()
- public function key()
- public function next()
- public function rewind()
- public function valid()
- private function throwOnAttemptedIteration()
- public function getPhobjectClassConstant($key, $byte_limit) — Read the value of a class constant.
- public function __construct()