Class: Griffin::Interceptors::Server::XRequestIdInterceptor

Inherits:
GRPC::ServerInterceptor
  • Object
show all
Defined in:
lib/griffin/interceptors/server/x_request_id_interceptor.rb

Constant Summary collapse

KEY =
'x-request-id'

Instance Method Summary collapse

Instance Method Details

#request_response(call: nil) ⇒ Object Also known as: server_streamer, client_streamer, bidi_streamer



11
12
13
14
15
16
17
# File 'lib/griffin/interceptors/server/x_request_id_interceptor.rb', line 11

def request_response(call: nil, **)
  unless call.[KEY]
    call.[KEY] = SecureRandom.uuid
  end

  yield
end