Class: SlowService
- 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 slow test service.
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(_default_var = 'ignored') ⇒ SlowService
constructor
A new instance of SlowService.
Methods included from GRPC::GenericService
Constructor Details
#initialize(_default_var = 'ignored') ⇒ SlowService
Returns a new instance of SlowService.
66 67 68 69 |
# 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 66 def initialize(_default_var = 'ignored') @delay = 0.25 @received_md = [] end |
Instance Attribute Details
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
64 65 66 |
# 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 64 def delay @delay end |
#received_md ⇒ Object (readonly)
Returns the value of attribute received_md.
64 65 66 |
# 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 64 def received_md @received_md end |
Instance Method Details
#an_rpc(req, call) ⇒ Object
71 72 73 74 75 76 |
# 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 71 def an_rpc(req, call) GRPC.logger.info("starting a slow #{@delay} rpc") sleep @delay @received_md << call. unless call..nil? req # send back the req as the response end |