Pipe
Pipe
class Pipe implements \Hazaar\Warlock\Interface\ConnectionImplements: Hazaar\Warlock\Interface\Connection
Properties
bytesReceived
Total number of bytes received from stdin.
public int $bytesReceivedType: int
guid
public string $guidType: string
protocol
Protocol encoder/decoder for packet payloads.
private Protocol $protocolType: Hazaar\Warlock\Protocol
buffer
Incomplete receive buffer awaiting a line terminator.
private string $bufferType: string
Methods
__construct
public __construct(Protocol $protocol, ?string $guid): voidParameters
| Parameter | Type | Description |
|---|---|---|
$protocol | Hazaar\Warlock\Protocol | packet protocol implementation |
$guid | string | optional connection identifier |
configure
Pipe transport has no runtime configuration options.
public configure(array $config): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$config | array |
addHeaders
public addHeaders(array $headers): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$headers | array |
getHost
Returns fixed host label for pipe transports.
public getHost(): stringReturns: string
getPort
Returns fixed port value for pipe transports.
public getPort(): intReturns: int
connect
Pipe transport is always considered connected.
public connect(): boolReturns: bool
disconnect
Flushes stdout and marks pipe connection as closed.
public disconnect(): boolReturns: bool
connected
Pipe transport is always considered connected while process is alive.
public connected(): boolReturns: bool
send
Encodes and writes a packet to stdout.
public send(PacketType $command, mixed $payload): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$command | Hazaar\Warlock\Enum\PacketType | |
$payload | mixed |
recv
Reads and decodes one packet from stdin.
public recv(mixed $payload, int $tvSec = 3, int $tvUsec): false|PacketType|nullReturns: false|Hazaar\Warlock\Enum\PacketType|null
Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | mixed | |
$tvSec | int | |
$tvUsec | int |
processPacket
Extracts one newline-delimited packet from a buffered stream.
private processPacket(?string $buffer): bool|stringReturns: bool|string
Parameters
| Parameter | Type | Description |
|---|---|---|
$buffer | string |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000