Method: Gruf::Interceptors::Registry#use

Defined in:
lib/gruf/interceptors/registry.rb

#use(interceptor_class, options = {}) ⇒ Object

Add an interceptor to the registry

Parameters:

  • interceptor_class (Class)

    The class of the interceptor to add

  • options (Hash) (defaults to: {})

    A hash of options to pass into the interceptor during initialization



36
37
38
39
40
41
42
43
# File 'lib/gruf/interceptors/registry.rb', line 36

def use(interceptor_class, options = {})
  interceptors_mutex do
    @registry << {
      klass: interceptor_class,
      options: options
    }
  end
end