Class: GrpcKit::Call
- Inherits:
-
Object
- Object
- GrpcKit::Call
- Defined in:
- lib/grpc_kit/call.rb
Direct Known Subclasses
GrpcKit::Calls::Client::BidiStreamer, GrpcKit::Calls::Client::ClientStreamer, GrpcKit::Calls::Client::RequestResponse, GrpcKit::Calls::Client::ServerStreamer, GrpcKit::Calls::Server::BidiStreamer, GrpcKit::Calls::Server::ClientStreamer, GrpcKit::Calls::Server::RequestResponse, GrpcKit::Calls::Server::ServerStreamer
Defined Under Namespace
Instance Attribute Summary collapse
-
#metadata ⇒ Hash<String, String>
readonly
GRPC metadata.
-
#method ⇒ GrpcKit::Call::Name
readonly
GRPC method object.
-
#method_name ⇒ Symbol
readonly
GRPC method name.
-
#service_name ⇒ String
readonly
GRPC service name.
Instance Method Summary collapse
-
#deadline ⇒ Time
Deadline of this rpc call.
-
#initialize(stream:, config:, metadata:, timeout: nil) ⇒ Call
constructor
A new instance of Call.
Constructor Details
#initialize(stream:, config:, metadata:, timeout: nil) ⇒ Call
Returns a new instance of Call.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/grpc_kit/call.rb', line 24 def initialize(stream:, config:, metadata:, timeout: nil) @config = config @metadata = @method_name = @config.method_name @service_name = @config.service_name @codec = @config.codec @timeout = timeout @stream = stream # for compatible klass = Klass.new(@service_name) @method ||= Name.new(@method_name, Reciver.new(klass)) end |
Instance Attribute Details
#metadata ⇒ Hash<String, String> (readonly)
Returns gRPC metadata.
19 20 21 |
# File 'lib/grpc_kit/call.rb', line 19 def @metadata end |
#method ⇒ GrpcKit::Call::Name (readonly)
Returns gRPC method object.
10 11 12 |
# File 'lib/grpc_kit/call.rb', line 10 def method @method end |
#method_name ⇒ Symbol (readonly)
Returns gRPC method name.
13 14 15 |
# File 'lib/grpc_kit/call.rb', line 13 def method_name @method_name end |
#service_name ⇒ String (readonly)
Returns gRPC service name.
16 17 18 |
# File 'lib/grpc_kit/call.rb', line 16 def service_name @service_name end |
Instance Method Details
#deadline ⇒ Time
Returns deadline of this rpc call.
39 40 41 42 43 |
# File 'lib/grpc_kit/call.rb', line 39 def deadline return @deadline if instance_variable_defined?(:@deadline) @deadline = @timeout && @timeout.to_absolute_time end |