public function do(InternalRequest $ireq)
{
$headers = yield;
if ($headers[":status"] == 101) {
$yield = (yield $headers);
} else {
return $headers;
// detach if we don't want to establish websocket connection
}
while ($yield !== null) {
$yield = (yield $yield);
}
\Amp\immediately([$this, "reapClient"], ["cb_data" => $ireq]);
}