|
|
|
@ -96,18 +96,18 @@ class ChangeMetadataInterceptor extends Grpc\Interceptor |
|
|
|
|
public function interceptUnaryUnary($method, |
|
|
|
|
$argument, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
$metadata["foo"] = array('interceptor_from_unary_request'); |
|
|
|
|
return $continuation($method, $argument, $deserialize, $metadata, $options); |
|
|
|
|
} |
|
|
|
|
public function interceptStreamUnary($method, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
$metadata["foo"] = array('interceptor_from_stream_request'); |
|
|
|
|
return $continuation($method, $deserialize, $metadata, $options); |
|
|
|
@ -119,9 +119,9 @@ class ChangeMetadataInterceptor2 extends Grpc\Interceptor |
|
|
|
|
public function interceptUnaryUnary($method, |
|
|
|
|
$argument, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
if (array_key_exists('foo', $metadata)) { |
|
|
|
|
$metadata['bar'] = array('ChangeMetadataInterceptor should be executed first'); |
|
|
|
@ -132,9 +132,9 @@ class ChangeMetadataInterceptor2 extends Grpc\Interceptor |
|
|
|
|
} |
|
|
|
|
public function interceptStreamUnary($method, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
if (array_key_exists('foo', $metadata)) { |
|
|
|
|
$metadata['bar'] = array('ChangeMetadataInterceptor should be executed first'); |
|
|
|
@ -175,18 +175,18 @@ class ChangeRequestInterceptor extends Grpc\Interceptor |
|
|
|
|
public function interceptUnaryUnary($method, |
|
|
|
|
$argument, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
$argument->setData('intercepted_unary_request'); |
|
|
|
|
return $continuation($method, $argument, $deserialize, $metadata, $options); |
|
|
|
|
} |
|
|
|
|
public function interceptStreamUnary($method, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
return new ChangeRequestCall( |
|
|
|
|
$continuation($method, $deserialize, $metadata, $options) |
|
|
|
@ -199,17 +199,17 @@ class StopCallInterceptor extends Grpc\Interceptor |
|
|
|
|
public function interceptUnaryUnary($method, |
|
|
|
|
$argument, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
$metadata["foo"] = array('interceptor_from_request_response'); |
|
|
|
|
} |
|
|
|
|
public function interceptStreamUnary($method, |
|
|
|
|
$deserialize, |
|
|
|
|
$continuation, |
|
|
|
|
array $metadata = [], |
|
|
|
|
array $options = [], |
|
|
|
|
$continuation) |
|
|
|
|
array $options = []) |
|
|
|
|
{ |
|
|
|
|
$metadata["foo"] = array('interceptor_from_request_response'); |
|
|
|
|
} |
|
|
|
|