aPipes
MMO\core\classes · 1 symbol · generated 5 Oct 2026
aPipes
aPipes.php:18Base class for feeding a subprocess's stdin and reading its stdout/stderr without blocking, used by
- Namespace
MMO\core\classes- See
Process(via its platform-specificUnixPipes/,WindowsPipessubclasses). Input can be a plain string/scalar (buffered whole), a stream resource (read and written inCHUNK_SIZEchunks as the subprocess drains stdin), or an \Iterator yielding either of those (each item is fully written before the next is pulled).
Index
| CHUNK_SIZE | Chunk size (bytes) used when streaming a resource/iterator input to the subprocess. | |
| TIMEOUT_PRECISION | ||
| blocked | ||
| input | ||
| inputBuffer | ||
| pipes | ||
| areOpen() abstract | ||
| close() | Close every open pipe. | |
| haveReadSupport() abstract | ||
| readAndWrite($blocking, $close) abstract | Read what is available on the output pipes, and write what is pending on the input. | |
| unblock() | Switch every pipe (and the input resource, if any) to non-blocking mode, so reads/writes never stall waiting on the subprocess. | |
| write() | Write as much of the pending input to the subprocess's stdin (pipe 0) as it will currently accept without blocking, then return. | |
| __construct($input) | ||
| __destruct() |
Constants2
CHUNK_SIZE
Chunk size (bytes) used when streaming a resource/iterator input to the subprocess.
TIMEOUT_PRECISION
Properties4
blocked
input
inputBuffer
pipes
Methods8
areOpen()
abstractaPipes.php:23| returns | bool | whether any pipe is still open |
close()
aPipes.php:66Close every open pipe.
| returns |
haveReadSupport()
abstractaPipes.php:20| returns | bool | whether the pipes can be read (a process started without any output capture cannot) |
readAndWrite($blocking, $close)
abstractaPipes.php:31Read what is available on the output pipes, and write what is pending on the input.
unblock()
aPipes.php:96Switch every pipe (and the input resource, if any) to non-blocking mode, so reads/writes never stall waiting on the subprocess. A no-op once already unblocked.
| returns |
write()
aPipes.php:115Write as much of the pending input to the subprocess's stdin (pipe 0) as it will currently accept without blocking, then return. Call this repeatedly (typically from a select()-driven loop) until it returns null with the input fully drained -- it self-closes stdin once there is nothing left to write.
| returns | null | array | the still-pending write-watch list (stdin's pipe, wrapped in an array) if more input remains to write later; null once stdin has been closed (input fully sent) or on a transient condition where nothing could be determined yet |
| throws | When an input iterator yields a value that is not a scalar or a stream resource |
__construct($input)
aPipes.php:53| $input | a stream resource or \Iterator is written incrementally as the subprocess reads it; anything else is cast to string and buffered whole |