Class: SynchronizedCancellationService
- Includes:
- GRPC::GenericService
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/spec/generic/rpc_server_spec.rb
Overview
A test service that allows a synchronized RPC cancellation
Instance Attribute Summary collapse
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
-
#received_md ⇒ Object
readonly
Returns the value of attribute received_md.
Instance Method Summary collapse
- #an_rpc(req, _call) ⇒ Object
-
#initialize(notify_request_received, wait_until_rpc_cancelled) ⇒ SynchronizedCancellationService
constructor
notify_request_received and wait_until_rpc_cancelled are callbacks to synchronously allow the client to proceed with cancellation (after the unary request has been received), and to synchronously wait until the client has cancelled the current RPC.
Methods included from GRPC::GenericService
Constructor Details
#initialize(notify_request_received, wait_until_rpc_cancelled) ⇒ SynchronizedCancellationService
notify_request_received and wait_until_rpc_cancelled are callbacks to synchronously allow the client to proceed with cancellation (after the unary request has been received), and to synchronously wait until the client has cancelled the current RPC.
92 93 94 95 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/spec/generic/rpc_server_spec.rb', line 92 def initialize(notify_request_received, wait_until_rpc_cancelled) @notify_request_received = notify_request_received @wait_until_rpc_cancelled = wait_until_rpc_cancelled end |
Instance Attribute Details
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
85 86 87 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/spec/generic/rpc_server_spec.rb', line 85 def delay @delay end |
#received_md ⇒ Object (readonly)
Returns the value of attribute received_md.
85 86 87 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/spec/generic/rpc_server_spec.rb', line 85 def received_md @received_md end |
Instance Method Details
#an_rpc(req, _call) ⇒ Object
97 98 99 100 101 102 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/spec/generic/rpc_server_spec.rb', line 97 def an_rpc(req, _call) GRPC.logger.info('starting a synchronusly cancelled rpc') @notify_request_received.call(req) @wait_until_rpc_cancelled.call req # send back the req as the response end |