Ferreteria/v0.6/clade/IO/Aspect/Connx/Stream

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | Aspect‎ | Connx
Jump to navigation Jump to search
clade: IO\Aspect\Connx\Stream
Clade Family
Connx Stream
Clade Aliases
Alias Clade
Base* [ca,i] IO\Aspect\Connx
CommOp* [c,i] Sys\Events\ItWent\CommOp
Inspect* [c,i] IO\Aspect\Connx\aux\Inspect\VStream
Rdouter* [i,t] IO\Aspect\view\has\AReadout
Subpages

Thinking

  • 2025-12-17 I guess I'll go with the idea that a stream can be bidirectional -- so methods are available for both -- but it may need to be configured for how you're using it

Code

as of 2026-01-08:

interface iStream extends BaseIface, RdouterIface {
    // STATUS
    function MoreBytes() : bool;
    function NPulledBytes() : int;   // bytes already processed/transferred (read or written)
    // ACTION (I/O)
    function PullBytes(int $nMax=NULL) : CommOpIface;
    function PushBytes(string $s) : int|null;          // add on as new bytes
}
abstract class caStream extends BaseClass implements iStream {
    use RdouterTrait;

    // ++ CONFIG ++ //

    protected function InspectorClass() : string { return InspectClass::class; }

    // -- CONFIG -- //
    // ++ STATUS ++ //

    protected $nPulled = 0;
    public function NPulledBytes() : int { return $this->nPulled; }
    protected function ResetPulled() { $this->nPulled = 0; }

    // -- STATUS -- //
}