mirror of
https://github.com/danog/byte-stream.git
synced 2024-12-02 09:17:50 +01:00
29 lines
484 B
PHP
29 lines
484 B
PHP
<?php
|
|
|
|
namespace Amp\ByteStream;
|
|
|
|
use Amp\Promise;
|
|
|
|
interface WritableStream {
|
|
/**
|
|
* Determines if the stream is writable.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function isWritable(): bool;
|
|
|
|
/**
|
|
* @param string $data
|
|
*
|
|
* @return \Amp\Promise<int>
|
|
*/
|
|
public function write(string $data): Promise;
|
|
|
|
/**
|
|
* @param string $data
|
|
*
|
|
* @return \Amp\Promise<int>
|
|
*/
|
|
public function end(string $data = ''): Promise;
|
|
}
|