2016-12-30 06:09:06 +01:00
|
|
|
<?php
|
2016-08-16 23:23:46 +02:00
|
|
|
|
2017-03-16 16:22:32 +01:00
|
|
|
namespace Amp\ByteStream;
|
2016-08-10 23:48:42 +02:00
|
|
|
|
2017-03-16 16:22:32 +01:00
|
|
|
use Amp\Promise;
|
2016-08-16 00:19:32 +02:00
|
|
|
|
2017-03-24 00:38:15 +01:00
|
|
|
interface WritableStream {
|
2016-08-10 23:48:42 +02:00
|
|
|
/**
|
|
|
|
* @param string $data
|
|
|
|
*
|
2017-03-16 16:22:32 +01:00
|
|
|
* @return \Amp\Promise<int>
|
2016-08-10 23:48:42 +02:00
|
|
|
*/
|
2016-11-14 22:05:19 +01:00
|
|
|
public function write(string $data): Promise;
|
2016-08-10 23:48:42 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $data
|
|
|
|
*
|
2017-03-16 16:22:32 +01:00
|
|
|
* @return \Amp\Promise<int>
|
2016-08-10 23:48:42 +02:00
|
|
|
*/
|
2016-11-14 22:05:19 +01:00
|
|
|
public function end(string $data = ''): Promise;
|
2016-08-10 23:48:42 +02:00
|
|
|
}
|