Stream::close can throw Amp\ByteStream\ClosedException
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Nsq;
|
namespace Nsq;
|
||||||
|
|
||||||
|
use Amp\ByteStream\ClosedException;
|
||||||
use Amp\Promise;
|
use Amp\Promise;
|
||||||
use Nsq\Config\ClientConfig;
|
use Nsq\Config\ClientConfig;
|
||||||
use Nsq\Config\ServerConfig;
|
use Nsq\Config\ServerConfig;
|
||||||
|
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Nsq;
|
namespace Nsq;
|
||||||
|
|
||||||
|
use Amp\ByteStream\ClosedException;
|
||||||
use Amp\Promise;
|
use Amp\Promise;
|
||||||
|
|
||||||
interface Stream
|
interface Stream
|
||||||
@@ -18,5 +19,8 @@ interface Stream
|
|||||||
*/
|
*/
|
||||||
public function write(string $data): Promise;
|
public function write(string $data): Promise;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws ClosedException
|
||||||
|
*/
|
||||||
public function close(): void;
|
public function close(): void;
|
||||||
}
|
}
|
||||||
|
@@ -63,6 +63,9 @@ class SocketStream implements Stream
|
|||||||
return $this->socket->write($data);
|
return $this->socket->write($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
public function close(): void
|
public function close(): void
|
||||||
{
|
{
|
||||||
$this->socket->close();
|
$this->socket->close();
|
||||||
|
Reference in New Issue
Block a user