mlumish | 156e67d | 2015-01-02 14:59:16 -0800 | [diff] [blame^] | 1 | <?php |
| 2 | namespace Grpc; |
| 3 | require_once realpath(dirname(__FILE__) . '/../autoload.php'); |
| 4 | |
| 5 | /** |
| 6 | * Represents an active call that allows for sending and recieving messages in |
| 7 | * streams in any order. |
| 8 | */ |
| 9 | class BidiStreamingSurfaceActiveCall extends AbstractSurfaceActiveCall { |
| 10 | |
| 11 | /** |
| 12 | * Reads the next value from the server. |
| 13 | * @return The next value from the server, or null if there is none |
| 14 | */ |
| 15 | public function read() { |
| 16 | return $this->_read(); |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Writes a single message to the server. This cannot be called after |
| 21 | * writesDone is called. |
| 22 | * @param $value The message to send |
| 23 | */ |
| 24 | public function write($value) { |
| 25 | $this->_write($value); |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Indicate that no more writes will be sent |
| 30 | */ |
| 31 | public function writesDone() { |
| 32 | $this->_writesDone(); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Wait for the server to send the status, and return it. |
| 37 | * @return object The status object, with integer $code and string $details |
| 38 | * members |
| 39 | */ |
| 40 | public function getStatus() { |
| 41 | return $this->_getStatus(); |
| 42 | } |
| 43 | } |