Aerys\Websocket\Rfc6455Endpoint::compile PHP Method

compile() private method

private compile ( Aerys\Websocket\Rfc6455Client $client, string $msg, integer $opcode, boolean $fin = true ) : Promise
$client Aerys\Websocket\Rfc6455Client
$msg string
$opcode integer
$fin boolean
return Promise
    private function compile(Rfc6455Client $client, string $msg, int $opcode, bool $fin = true) : Promise
    {
        $frameInfo = ["msg" => $msg, "rsv" => 0b0, "fin" => $fin, "opcode" => $opcode];
        // @TODO filter mechanism …?! (e.g. gzip)
        foreach ($client->builder as $gen) {
            $gen->send($frameInfo);
            $gen->send(null);
            $frameInfo = $gen->current();
        }
        return $this->write($client, $frameInfo);
    }