<?php

declare(strict_types=1);

namespace PhpWA\Transport\WebSocket;

use PhpWA\Runtime\Deadline;

interface WebSocketInterface
{
    public function connect(?Deadline $deadline = null): void;
    public function sendBinary(string $payload, Deadline $deadline): void;
    public function receiveBinary(Deadline $deadline): string;
    public function close(int $code = 1000, string $reason = ''): void;
    public function isOpen(): bool;
}
