Class: GrpcKit::Client
- Inherits:
-
Object
- Object
- GrpcKit::Client
- Defined in:
- lib/grpc_kit/client.rb
Instance Method Summary collapse
- #bidi_streamer(rpc, _requests, **opts) ⇒ Object
- #client_streamer(rpc, **opts) ⇒ Object
-
#initialize(sock, authority: nil, interceptors: [], timeout: nil, max_receive_message_size: nil, max_send_message_size: nil) ⇒ Client
constructor
A new instance of Client.
- #request_response(rpc, request, **opts) ⇒ Object
- #server_streamer(rpc, request, **opts) ⇒ Object
Constructor Details
#initialize(sock, authority: nil, interceptors: [], timeout: nil, max_receive_message_size: nil, max_send_message_size: nil) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/grpc_kit/client.rb', line 17 def initialize(sock, authority: nil, interceptors: [], timeout: nil, max_receive_message_size: nil, max_send_message_size: nil) @sock = sock @authority = if else addr = sock.addr "#{addr[3]}:#{addr[1]}" end @timeout = timeout && GrpcKit::GrpcTime.new(timeout) # Defined at GrpcKit::Grpc::Dsl#.rpc_stub_class build_rpcs( interceptors, max_receive_message_size: , max_send_message_size: , ) end |
Instance Method Details
#bidi_streamer(rpc, _requests, **opts) ⇒ Object
63 64 65 66 |
# File 'lib/grpc_kit/client.rb', line 63 def bidi_streamer(rpc, _requests, **opts) GrpcKit.logger.debug('Calling bidi_streamer') do_request(rpc, nil, **opts) end |
#client_streamer(rpc, **opts) ⇒ Object
47 48 49 50 |
# File 'lib/grpc_kit/client.rb', line 47 def client_streamer(rpc, **opts) GrpcKit.logger.debug('Calling client_streamer') do_request(rpc, nil, **opts) end |