aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/lib/Grpc/AbstractCall.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php/lib/Grpc/AbstractCall.php')
-rw-r--r--src/php/lib/Grpc/AbstractCall.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/php/lib/Grpc/AbstractCall.php b/src/php/lib/Grpc/AbstractCall.php
index 35057224f8..3fdaf2e487 100644
--- a/src/php/lib/Grpc/AbstractCall.php
+++ b/src/php/lib/Grpc/AbstractCall.php
@@ -92,4 +92,20 @@ abstract class AbstractCall {
}
return call_user_func($this->deserialize, $value);
}
-} \ No newline at end of file
+
+ /**
+ * Get the list of Grpc Write Flags
+ * @param array $options an array of options
+ * @return The list of Grpc Write Flags contained in the input
+ */
+ protected static function getGrpcWriteFlags($options) {
+ $grpc_write_flags = [];
+ foreach ([WRITE_BUFFER_HINT,
+ WRITE_NO_COMPRESS] as $flag) {
+ if (in_array($flag, $options)) {
+ $grpc_write_flags[] = $flag;
+ }
+ }
+ return $grpc_write_flags;
+ }
+}