Class: GrpcKit::Calls::Call

Inherits:
Object
  • Object
show all
Defined in:
lib/grpc_kit/calls.rb

Defined Under Namespace

Classes: Klass, Name, Reciver

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream:, config:, metadata:, timeout: nil) ⇒ Call

Returns a new instance of Call.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/grpc_kit/calls.rb', line 14

def initialize(stream:, config:, metadata:, timeout: nil)
  @config = config
  @metadata = 
  @method_name = @config.method_name
  @service_name = @config.service_name
  @protobuf = @config.protobuf
  @timeout = timeout
  @stream = stream

  # for compatible
  klass = Klass.new(@service_name)
  @method ||= Name.new(@method_name, Reciver.new(klass))
  @restrict = false
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



9
10
11
# File 'lib/grpc_kit/calls.rb', line 9

def method
  @method
end

Instance Method Details

#deadlineObject



37
38
39
# File 'lib/grpc_kit/calls.rb', line 37

def deadline
  @deadline ||= @timeout.to_absolute_time
end

#normal_modeObject



33
34
35
# File 'lib/grpc_kit/calls.rb', line 33

def normal_mode
  @restrict = false
end

#restrict_modeObject



29
30
31
# File 'lib/grpc_kit/calls.rb', line 29

def restrict_mode
  @restrict = true
end