Class: GrpcKit::Calls::Call
- Inherits:
-
Object
- Object
- GrpcKit::Calls::Call
- Defined in:
- lib/grpc_kit/calls.rb
Direct Known Subclasses
GrpcKit::Calls::Client::ClientStreamer, GrpcKit::Calls::Client::RequestResponse, GrpcKit::Calls::Client::ServerStreamer, Server::ClientStreamer, Server::RequestResponse, Server::ServerStreamer
Defined Under Namespace
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
- #deadline ⇒ Object
-
#initialize(stream:, config:, metadata:, timeout: nil) ⇒ Call
constructor
A new instance of Call.
- #normal_mode ⇒ Object
- #restrict_mode ⇒ Object
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
#method ⇒ Object (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
#deadline ⇒ Object
37 38 39 |
# File 'lib/grpc_kit/calls.rb', line 37 def deadline @deadline ||= @timeout.to_absolute_time end |
#normal_mode ⇒ Object
33 34 35 |
# File 'lib/grpc_kit/calls.rb', line 33 def normal_mode @restrict = false end |
#restrict_mode ⇒ Object
29 30 31 |
# File 'lib/grpc_kit/calls.rb', line 29 def restrict_mode @restrict = true end |