Class: Griffin::Interceptors::Server::TimeoutInterceptor
- Inherits:
-
GRPC::ServerInterceptor
- Object
- GRPC::ServerInterceptor
- Griffin::Interceptors::Server::TimeoutInterceptor
- Defined in:
- lib/griffin/interceptors/server/timeout_interceptor.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
5
Instance Method Summary collapse
-
#initialize(timeout = DEFAULT_TIMEOUT) ⇒ TimeoutInterceptor
constructor
A new instance of TimeoutInterceptor.
- #request_response ⇒ Object
Constructor Details
#initialize(timeout = DEFAULT_TIMEOUT) ⇒ TimeoutInterceptor
Returns a new instance of TimeoutInterceptor.
11 12 13 |
# File 'lib/griffin/interceptors/server/timeout_interceptor.rb', line 11 def initialize(timeout = DEFAULT_TIMEOUT) @timeout = timeout end |
Instance Method Details
#request_response ⇒ Object
15 16 17 18 19 |
# File 'lib/griffin/interceptors/server/timeout_interceptor.rb', line 15 def request_response(*) Timeout.timeout(@timeout) do yield end end |