Class: ReloaderInterceptor::ServerInterceptor

Inherits:
GRPC::ServerInterceptor
  • Object
show all
Defined in:
lib/reloader_interceptor/server_interceptor.rb

Instance Method Summary collapse

Constructor Details

#initialize(reloader: nil) ⇒ ServerInterceptor

Returns a new instance of ServerInterceptor.

Parameters:

  • reloader (Class, nil) (defaults to: nil)

    A class which inherits ActiveSupport::Reloader



6
7
8
# File 'lib/reloader_interceptor/server_interceptor.rb', line 6

def initialize(reloader: nil)
  @reloader = reloader
end

Instance Method Details

#request_response(request:, call:, method:, &block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/reloader_interceptor/server_interceptor.rb', line 10

def request_response(request:, call:, method:, &block)
  return yield unless ReloaderInterceptor.enabled?

  reloader.wrap do
    yield
  end
end