Class: Prefab::CancellableInterceptor
- Inherits:
-
GRPC::ClientInterceptor
- Object
- GRPC::ClientInterceptor
- Prefab::CancellableInterceptor
- Defined in:
- lib/prefab/cancellable_interceptor.rb
Instance Method Summary collapse
- #bidi_streamer(requests:, call:, method:, metadata:, &block) ⇒ Object
- #cancel ⇒ Object
- #client_streamer(requests:, call:, method:, metadata:, &block) ⇒ Object
- #request_response(request:, call:, method:, metadata:, &block) ⇒ Object
- #server_streamer(request:, call:, method:, metadata:, &block) ⇒ Object
- #shared(call) ⇒ Object
Instance Method Details
#bidi_streamer(requests:, call:, method:, metadata:, &block) ⇒ Object
20 21 22 |
# File 'lib/prefab/cancellable_interceptor.rb', line 20 def bidi_streamer(requests:, call:, method:, metadata:, &block) shared(call, &block) end |
#cancel ⇒ Object
4 5 6 |
# File 'lib/prefab/cancellable_interceptor.rb', line 4 def cancel @call.instance_variable_get("@wrapped").instance_variable_get("@call").cancel end |
#client_streamer(requests:, call:, method:, metadata:, &block) ⇒ Object
12 13 14 |
# File 'lib/prefab/cancellable_interceptor.rb', line 12 def client_streamer(requests:, call:, method:, metadata:, &block) shared(call, &block) end |
#request_response(request:, call:, method:, metadata:, &block) ⇒ Object
8 9 10 |
# File 'lib/prefab/cancellable_interceptor.rb', line 8 def request_response(request:, call:, method:, metadata:, &block) shared(call, &block) end |
#server_streamer(request:, call:, method:, metadata:, &block) ⇒ Object
16 17 18 |
# File 'lib/prefab/cancellable_interceptor.rb', line 16 def server_streamer(request:, call:, method:, metadata:, &block) shared(call, &block) end |
#shared(call) ⇒ Object
24 25 26 27 |
# File 'lib/prefab/cancellable_interceptor.rb', line 24 def shared(call) @call = call yield end |