Class: Momento::TransportStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/momento/config/transport/transport_strategy.rb

Overview

Low-level gRPC settings for communication with the Momento server

Direct Known Subclasses

StaticTransportStrategy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grpc_configuration) ⇒ TransportStrategy

Returns a new instance of TransportStrategy.



10
11
12
13
14
# File 'lib/momento/config/transport/transport_strategy.rb', line 10

def initialize(grpc_configuration)
  @grpc_configuration = grpc_configuration
rescue StandardError
  raise Momento::Error::InvalidArgumentError, 'invalid gRPC configuration'
end

Instance Attribute Details

#grpc_configurationObject (readonly)

Returns the value of attribute grpc_configuration.



4
5
6
# File 'lib/momento/config/transport/transport_strategy.rb', line 4

def grpc_configuration
  @grpc_configuration
end

Instance Method Details

#with_grpc_configuration(grpc_configuration) ⇒ Object



6
7
8
# File 'lib/momento/config/transport/transport_strategy.rb', line 6

def with_grpc_configuration(grpc_configuration)
  return TransportStrategy.new(grpc_configuration)
end