diff options
author | Stanley Cheung <stanleycheung@google.com> | 2015-08-24 16:58:42 -0700 |
---|---|---|
committer | Stanley Cheung <stanleycheung@google.com> | 2015-09-02 13:34:40 -0700 |
commit | 3ab8e79b0111dc93696d72e815531b5ee3124230 (patch) | |
tree | badc54d70b58bb289fda46dba0d0314d1d08a492 /src/php/lib/Grpc/BidiStreamingCall.php | |
parent | dea2648a6acb5c16b158335b4deb02caf4f02487 (diff) |
php: support per message compression disable
Diffstat (limited to 'src/php/lib/Grpc/BidiStreamingCall.php')
-rw-r--r-- | src/php/lib/Grpc/BidiStreamingCall.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/php/lib/Grpc/BidiStreamingCall.php b/src/php/lib/Grpc/BidiStreamingCall.php index 76c642bef4..80b7a66a76 100644 --- a/src/php/lib/Grpc/BidiStreamingCall.php +++ b/src/php/lib/Grpc/BidiStreamingCall.php @@ -66,9 +66,14 @@ class BidiStreamingCall extends AbstractCall { * Write a single message to the server. This cannot be called after * writesDone is called. * @param ByteBuffer $data The data to write + * @param array $options an array of options */ - public function write($data) { - $this->call->startBatch([OP_SEND_MESSAGE => $data->serialize()]); + public function write($data, $options = array()) { + $message_array = ['message' => $data->serialize()]; + if ($grpc_write_flags = self::getGrpcWriteFlags($options)) { + $message_array['flags'] = $grpc_write_flags; + } + $this->call->startBatch([OP_SEND_MESSAGE => $message_array]); } /** @@ -86,7 +91,7 @@ class BidiStreamingCall extends AbstractCall { public function getStatus() { $status_event = $this->call->startBatch([ OP_RECV_STATUS_ON_CLIENT => true - ]); + ]); return $status_event->status; } }
\ No newline at end of file |