Class: GRPC::InterceptorRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/lib/grpc/generic/interceptor_registry.rb

Overview

Represents a registry of added interceptors available for enumeration. The registry can be used for both server and client interceptors. This class is internal to gRPC and not meant for public usage.

Defined Under Namespace

Classes: DescendantError

Instance Method Summary collapse

Constructor Details

#initialize(interceptors = []) ⇒ InterceptorRegistry

Initialize the registry with an empty interceptor list This is an EXPERIMENTAL API.



33
34
35
36
37
38
39
40
41
42
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/lib/grpc/generic/interceptor_registry.rb', line 33

def initialize(interceptors = [])
  @interceptors = []
  interceptors.each do |i|
    base = GRPC::Interceptor
    unless i.class.ancestors.include?(base)
      fail DescendantError, "Interceptors must descend from #{base}"
    end
    @interceptors << i
  end
end

Instance Method Details

#build_contextInterceptionContext

Builds an interception context from this registry

Returns:



49
50
51
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/grpc-1.50.0-x86_64-linux/src/ruby/lib/grpc/generic/interceptor_registry.rb', line 49

def build_context
  InterceptionContext.new(@interceptors)
end