Skip to content
Snippets Groups Projects
Commit 2b563761 authored by Tim Emiola's avatar Tim Emiola
Browse files

Updates ruby to stop using grpc_start_invoke

parent eb0fdb64
Branches
Tags
No related merge requests found
...@@ -153,7 +153,7 @@ int grpc_rb_call_add_metadata_hash_cb(VALUE key, VALUE val, VALUE call_obj) { ...@@ -153,7 +153,7 @@ int grpc_rb_call_add_metadata_hash_cb(VALUE key, VALUE val, VALUE call_obj) {
Add metadata elements to the call from a ruby hash, to be sent upon Add metadata elements to the call from a ruby hash, to be sent upon
invocation. flags is a bit-field combination of the write flags defined invocation. flags is a bit-field combination of the write flags defined
above. REQUIRES: grpc_call_start_invoke/grpc_call_accept have not been above. REQUIRES: grpc_call_invoke/grpc_call_accept have not been
called on this call. Produces no events. */ called on this call. Produces no events. */
static VALUE grpc_rb_call_add_metadata(int argc, VALUE *argv, VALUE self) { static VALUE grpc_rb_call_add_metadata(int argc, VALUE *argv, VALUE self) {
...@@ -196,16 +196,15 @@ static VALUE grpc_rb_call_cancel(VALUE self) { ...@@ -196,16 +196,15 @@ static VALUE grpc_rb_call_cancel(VALUE self) {
/* /*
call-seq: call-seq:
call.start_invoke(completion_queue, tag, flags=nil) call.invoke(completion_queue, tag, flags=nil)
Invoke the RPC. Starts sending metadata and request headers on the wire. Invoke the RPC. Starts sending metadata and request headers on the wire.
flags is a bit-field combination of the write flags defined above. flags is a bit-field combination of the write flags defined above.
REQUIRES: Can be called at most once per call. REQUIRES: Can be called at most once per call.
Can only be called on the client. Can only be called on the client.
Produces a GRPC_INVOKE_ACCEPTED event on completion. */ Produces a GRPC_INVOKE_ACCEPTED event on completion. */
static VALUE grpc_rb_call_start_invoke(int argc, VALUE *argv, VALUE self) { static VALUE grpc_rb_call_invoke(int argc, VALUE *argv, VALUE self) {
VALUE cqueue = Qnil; VALUE cqueue = Qnil;
VALUE invoke_accepted_tag = Qnil;
VALUE metadata_read_tag = Qnil; VALUE metadata_read_tag = Qnil;
VALUE finished_tag = Qnil; VALUE finished_tag = Qnil;
VALUE flags = Qnil; VALUE flags = Qnil;
...@@ -213,17 +212,16 @@ static VALUE grpc_rb_call_start_invoke(int argc, VALUE *argv, VALUE self) { ...@@ -213,17 +212,16 @@ static VALUE grpc_rb_call_start_invoke(int argc, VALUE *argv, VALUE self) {
grpc_completion_queue *cq = NULL; grpc_completion_queue *cq = NULL;
grpc_call_error err; grpc_call_error err;
/* "41" == 4 mandatory args, 1 (flags) is optional */ /* "31" == 3 mandatory args, 1 (flags) is optional */
rb_scan_args(argc, argv, "41", &cqueue, &invoke_accepted_tag, rb_scan_args(argc, argv, "31", &cqueue, &metadata_read_tag, &finished_tag,
&metadata_read_tag, &finished_tag, &flags); &flags);
if (NIL_P(flags)) { if (NIL_P(flags)) {
flags = UINT2NUM(0); /* Default to no flags */ flags = UINT2NUM(0); /* Default to no flags */
} }
cq = grpc_rb_get_wrapped_completion_queue(cqueue); cq = grpc_rb_get_wrapped_completion_queue(cqueue);
Data_Get_Struct(self, grpc_call, call); Data_Get_Struct(self, grpc_call, call);
err = grpc_call_start_invoke(call, cq, ROBJECT(invoke_accepted_tag), err = grpc_call_invoke(call, cq, ROBJECT(metadata_read_tag),
ROBJECT(metadata_read_tag), ROBJECT(finished_tag), NUM2UINT(flags));
ROBJECT(finished_tag), NUM2UINT(flags));
if (err != GRPC_CALL_OK) { if (err != GRPC_CALL_OK) {
rb_raise(rb_eCallError, "invoke failed: %s (code=%d)", rb_raise(rb_eCallError, "invoke failed: %s (code=%d)",
grpc_call_error_detail_of(err), err); grpc_call_error_detail_of(err), err);
...@@ -519,7 +517,7 @@ void Init_google_rpc_call() { ...@@ -519,7 +517,7 @@ void Init_google_rpc_call() {
grpc_rb_call_server_end_initial_metadata, -1); grpc_rb_call_server_end_initial_metadata, -1);
rb_define_method(rb_cCall, "add_metadata", grpc_rb_call_add_metadata, -1); rb_define_method(rb_cCall, "add_metadata", grpc_rb_call_add_metadata, -1);
rb_define_method(rb_cCall, "cancel", grpc_rb_call_cancel, 0); rb_define_method(rb_cCall, "cancel", grpc_rb_call_cancel, 0);
rb_define_method(rb_cCall, "start_invoke", grpc_rb_call_start_invoke, -1); rb_define_method(rb_cCall, "invoke", grpc_rb_call_invoke, -1);
rb_define_method(rb_cCall, "start_read", grpc_rb_call_start_read, 1); rb_define_method(rb_cCall, "start_read", grpc_rb_call_start_read, 1);
rb_define_method(rb_cCall, "start_write", grpc_rb_call_start_write, -1); rb_define_method(rb_cCall, "start_write", grpc_rb_call_start_write, -1);
rb_define_method(rb_cCall, "start_write_status", rb_define_method(rb_cCall, "start_write_status",
......
...@@ -105,10 +105,6 @@ static VALUE grpc_rb_event_type(VALUE self) { ...@@ -105,10 +105,6 @@ static VALUE grpc_rb_event_type(VALUE self) {
case GRPC_READ: case GRPC_READ:
return rb_const_get(rb_mCompletionType, rb_intern("READ")); return rb_const_get(rb_mCompletionType, rb_intern("READ"));
case GRPC_INVOKE_ACCEPTED:
grpc_rb_event_result(self); /* validates the result */
return rb_const_get(rb_mCompletionType, rb_intern("INVOKE_ACCEPTED"));
case GRPC_WRITE_ACCEPTED: case GRPC_WRITE_ACCEPTED:
grpc_rb_event_result(self); /* validates the result */ grpc_rb_event_result(self); /* validates the result */
return rb_const_get(rb_mCompletionType, rb_intern("WRITE_ACCEPTED")); return rb_const_get(rb_mCompletionType, rb_intern("WRITE_ACCEPTED"));
...@@ -359,6 +355,8 @@ void Init_google_rpc_event() { ...@@ -359,6 +355,8 @@ void Init_google_rpc_event() {
rb_define_const(rb_mCompletionType, "FINISHED", INT2NUM(GRPC_FINISHED)); rb_define_const(rb_mCompletionType, "FINISHED", INT2NUM(GRPC_FINISHED));
rb_define_const(rb_mCompletionType, "SERVER_RPC_NEW", rb_define_const(rb_mCompletionType, "SERVER_RPC_NEW",
INT2NUM(GRPC_SERVER_RPC_NEW)); INT2NUM(GRPC_SERVER_RPC_NEW));
rb_define_const(rb_mCompletionType, "SERVER_SHUTDOWN",
INT2NUM(GRPC_SERVER_SHUTDOWN));
rb_define_const(rb_mCompletionType, "RESERVED", rb_define_const(rb_mCompletionType, "RESERVED",
INT2NUM(GRPC_COMPLETION_DO_NOT_USE)); INT2NUM(GRPC_COMPLETION_DO_NOT_USE));
} }
......
# Copyright 2014, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc'
require 'signet'
module Google
import Signet::OAuth2
# Google::RPC contains the General RPC module.
module RPC
# ServiceAccounCredentials can obtain credentials for a configured service
# account, scopes and issuer.
module Auth
class ServiceAccountCredentials
CREDENTIAL_URI = 'https://accounts.google.com/o/oauth2/token'
AUDIENCE_URI = 'https://accounts.google.com/o/oauth2/token'
# Initializes an instance with the given scope, issuer and signing_key
def initialize(scope, issuer, key)
@auth_client = Client.new(token_credential_uri: CREDENTIAL_URI,
audience: AUDIENCE_URI,
scope: scope,
issuer: issuer,
signing_key: key)
@auth_token = nil
end
def metadata_update_proc
proc do |input_md|
input
end
end
def auth_creds
key = Google::APIClient::KeyUtils.load_from_pkcs12('client.p12', 'notasecret')
end
end
end
end
end
...@@ -47,7 +47,7 @@ module Google ...@@ -47,7 +47,7 @@ module Google
include Core::TimeConsts include Core::TimeConsts
attr_reader(:deadline) attr_reader(:deadline)
# client_start_invoke begins a client invocation. # client_invoke begins a client invocation.
# #
# Flow Control note: this blocks until flow control accepts that client # Flow Control note: this blocks until flow control accepts that client
# request can go ahead. # request can go ahead.
...@@ -59,9 +59,9 @@ module Google ...@@ -59,9 +59,9 @@ module Google
# if a keyword value is a list, multiple metadata for it's key are sent # if a keyword value is a list, multiple metadata for it's key are sent
# #
# @param call [Call] a call on which to start and invocation # @param call [Call] a call on which to start and invocation
# @param q [CompletionQueue] used to wait for INVOKE_ACCEPTED # @param q [CompletionQueue] the completion queue
# @param deadline [Fixnum,TimeSpec] the deadline for INVOKE_ACCEPTED # @param deadline [Fixnum,TimeSpec] the deadline
def self.client_start_invoke(call, q, _deadline, **kw) def self.client_invoke(call, q, _deadline, **kw)
fail(ArgumentError, 'not a call') unless call.is_a? Core::Call fail(ArgumentError, 'not a call') unless call.is_a? Core::Call
unless q.is_a? Core::CompletionQueue unless q.is_a? Core::CompletionQueue
fail(ArgumentError, 'not a CompletionQueue') fail(ArgumentError, 'not a CompletionQueue')
...@@ -69,24 +69,16 @@ module Google ...@@ -69,24 +69,16 @@ module Google
call.add_metadata(kw) if kw.length > 0 call.add_metadata(kw) if kw.length > 0
invoke_accepted, client_metadata_read = Object.new, Object.new invoke_accepted, client_metadata_read = Object.new, Object.new
finished_tag = Object.new finished_tag = Object.new
call.start_invoke(q, invoke_accepted, client_metadata_read, call.invoke(q, client_metadata_read, finished_tag)
finished_tag)
# wait for the invocation to be accepted
ev = q.pluck(invoke_accepted, INFINITE_FUTURE)
fail OutOfTime if ev.nil?
ev.close
[finished_tag, client_metadata_read] [finished_tag, client_metadata_read]
end end
# Creates an ActiveCall. # Creates an ActiveCall.
# #
# ActiveCall should only be created after a call is accepted. That means # ActiveCall should only be created after a call is accepted. That
# different things on a client and a server. On the client, the call is # means different things on a client and a server. On the client, the
# accepted after call.start_invoke followed by receipt of the # call is accepted after calling call.invoke. On the server, this is
# corresponding INVOKE_ACCEPTED. on the server, this is after # after call.accept.
# call.accept.
# #
# #initialize cannot determine if the call is accepted or not; so if a # #initialize cannot determine if the call is accepted or not; so if a
# call that's not accepted is used here, the error won't be visible until # call that's not accepted is used here, the error won't be visible until
...@@ -495,7 +487,7 @@ module Google ...@@ -495,7 +487,7 @@ module Google
private private
def start_call(**kw) def start_call(**kw)
tags = ActiveCall.client_start_invoke(@call, @cq, @deadline, **kw) tags = ActiveCall.client_invoke(@call, @cq, @deadline, **kw)
@finished_tag, @read_metadata_tag = tags @finished_tag, @read_metadata_tag = tags
@started = true @started = true
end end
......
...@@ -50,9 +50,7 @@ module Google ...@@ -50,9 +50,7 @@ module Google
# #
# BidiCall should only be created after a call is accepted. That means # BidiCall should only be created after a call is accepted. That means
# different things on a client and a server. On the client, the call is # different things on a client and a server. On the client, the call is
# accepted after call.start_invoke followed by receipt of the # accepted after call.invoke. On the server, this is after call.accept.
# corresponding INVOKE_ACCEPTED. On the server, this is after
# call.accept.
# #
# #initialize cannot determine if the call is accepted or not; so if a # #initialize cannot determine if the call is accepted or not; so if a
# call that's not accepted is used here, the error won't be visible until # call that's not accepted is used here, the error won't be visible until
......
...@@ -122,24 +122,10 @@ describe GRPC::Core::Call do ...@@ -122,24 +122,10 @@ describe GRPC::Core::Call do
end end
end end
describe '#start_invoke' do
it 'should cause the INVOKE_ACCEPTED event' do
call = make_test_call
expect(call.start_invoke(@client_queue, @tag, @tag, @tag)).to be_nil
ev = @client_queue.next(deadline)
expect(ev.call).to be_a(GRPC::Core::Call)
expect(ev.tag).to be(@tag)
expect(ev.type).to be(GRPC::Core::CompletionType::INVOKE_ACCEPTED)
expect(ev.call).to_not be(call)
end
end
describe '#start_write' do describe '#start_write' do
it 'should cause the WRITE_ACCEPTED event' do it 'should cause the WRITE_ACCEPTED event' do
call = make_test_call call = make_test_call
call.start_invoke(@client_queue, @tag, @tag, @tag) call.invoke(@client_queue, @tag, @tag)
ev = @client_queue.next(deadline)
expect(ev.type).to be(GRPC::Core::CompletionType::INVOKE_ACCEPTED)
expect(call.start_write(GRPC::Core::ByteBuffer.new('test_start_write'), expect(call.start_write(GRPC::Core::ByteBuffer.new('test_start_write'),
@tag)).to be_nil @tag)).to be_nil
ev = @client_queue.next(deadline) ev = @client_queue.next(deadline)
......
...@@ -83,10 +83,7 @@ shared_context 'setup: tags' do ...@@ -83,10 +83,7 @@ shared_context 'setup: tags' do
def client_sends(call, sent = 'a message') def client_sends(call, sent = 'a message')
req = ByteBuffer.new(sent) req = ByteBuffer.new(sent)
call.start_invoke(@client_queue, @tag, @tag, @client_finished_tag) call.invoke(@client_queue, @tag, @client_finished_tag)
ev = @client_queue.pluck(@tag, TimeConsts::INFINITE_FUTURE)
expect(ev).not_to be_nil
expect(ev.type).to be(INVOKE_ACCEPTED)
call.start_write(req, @tag) call.start_write(req, @tag)
ev = @client_queue.pluck(@tag, TimeConsts::INFINITE_FUTURE) ev = @client_queue.pluck(@tag, TimeConsts::INFINITE_FUTURE)
expect(ev).not_to be_nil expect(ev).not_to be_nil
...@@ -233,8 +230,7 @@ shared_examples 'GRPC metadata delivery works OK' do ...@@ -233,8 +230,7 @@ shared_examples 'GRPC metadata delivery works OK' do
call.add_metadata(md) call.add_metadata(md)
# Client begins a call OK # Client begins a call OK
call.start_invoke(@client_queue, @tag, @tag, @client_finished_tag) call.invoke(@client_queue, @tag, @client_finished_tag)
expect_next_event_on(@client_queue, INVOKE_ACCEPTED, @tag)
# ... server has all metadata available even though the client did not # ... server has all metadata available even though the client did not
# send a write # send a write
......
...@@ -40,7 +40,8 @@ describe GRPC::Core::CompletionType do ...@@ -40,7 +40,8 @@ describe GRPC::Core::CompletionType do
CLIENT_METADATA_READ: 5, CLIENT_METADATA_READ: 5,
FINISHED: 6, FINISHED: 6,
SERVER_RPC_NEW: 7, SERVER_RPC_NEW: 7,
RESERVED: 8 SERVER_SHUTDOWN: 8,
RESERVED: 9
} }
end end
......
...@@ -60,8 +60,8 @@ describe GRPC::ActiveCall do ...@@ -60,8 +60,8 @@ describe GRPC::ActiveCall do
describe 'restricted view methods' do describe 'restricted view methods' do
before(:each) do before(:each) do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
@client_call = ActiveCall.new(call, @client_queue, @pass_through, @client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
finished_tag: done_tag, finished_tag: done_tag,
...@@ -92,8 +92,8 @@ describe GRPC::ActiveCall do ...@@ -92,8 +92,8 @@ describe GRPC::ActiveCall do
describe '#remote_send' do describe '#remote_send' do
it 'allows a client to send a payload to the server' do it 'allows a client to send a payload to the server' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
@client_call = ActiveCall.new(call, @client_queue, @pass_through, @client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
finished_tag: done_tag, finished_tag: done_tag,
...@@ -118,8 +118,8 @@ describe GRPC::ActiveCall do ...@@ -118,8 +118,8 @@ describe GRPC::ActiveCall do
it 'marshals the payload using the marshal func' do it 'marshals the payload using the marshal func' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
marshal = proc { |x| 'marshalled:' + x } marshal = proc { |x| 'marshalled:' + x }
client_call = ActiveCall.new(call, @client_queue, marshal, client_call = ActiveCall.new(call, @client_queue, marshal,
@pass_through, deadline, @pass_through, deadline,
...@@ -139,11 +139,11 @@ describe GRPC::ActiveCall do ...@@ -139,11 +139,11 @@ describe GRPC::ActiveCall do
end end
end end
describe '#client_start_invoke' do describe '#client_invoke' do
it 'sends keywords as metadata to the server when the are present' do it 'sends keywords as metadata to the server when the are present' do
call = make_test_call call = make_test_call
ActiveCall.client_start_invoke(call, @client_queue, deadline, ActiveCall.client_invoke(call, @client_queue, deadline,
k1: 'v1', k2: 'v2') k1: 'v1', k2: 'v2')
@server.request_call(@server_tag) @server.request_call(@server_tag)
ev = @server_queue.next(deadline) ev = @server_queue.next(deadline)
expect(ev).to_not be_nil expect(ev).to_not be_nil
...@@ -155,8 +155,8 @@ describe GRPC::ActiveCall do ...@@ -155,8 +155,8 @@ describe GRPC::ActiveCall do
describe '#remote_read' do describe '#remote_read' do
it 'reads the response sent by a server' do it 'reads the response sent by a server' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
finished_tag: done_tag, finished_tag: done_tag,
...@@ -170,8 +170,8 @@ describe GRPC::ActiveCall do ...@@ -170,8 +170,8 @@ describe GRPC::ActiveCall do
it 'saves metadata { status=200 } when the server adds no metadata' do it 'saves metadata { status=200 } when the server adds no metadata' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
finished_tag: done_tag, finished_tag: done_tag,
...@@ -187,8 +187,8 @@ describe GRPC::ActiveCall do ...@@ -187,8 +187,8 @@ describe GRPC::ActiveCall do
it 'saves metadata add by the server' do it 'saves metadata add by the server' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
finished_tag: done_tag, finished_tag: done_tag,
...@@ -205,7 +205,7 @@ describe GRPC::ActiveCall do ...@@ -205,7 +205,7 @@ describe GRPC::ActiveCall do
it 'get a nil msg before a status when an OK status is sent' do it 'get a nil msg before a status when an OK status is sent' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
...@@ -224,8 +224,8 @@ describe GRPC::ActiveCall do ...@@ -224,8 +224,8 @@ describe GRPC::ActiveCall do
it 'unmarshals the response using the unmarshal func' do it 'unmarshals the response using the unmarshal func' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
unmarshal = proc { |x| 'unmarshalled:' + x } unmarshal = proc { |x| 'unmarshalled:' + x }
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
unmarshal, deadline, unmarshal, deadline,
...@@ -251,8 +251,8 @@ describe GRPC::ActiveCall do ...@@ -251,8 +251,8 @@ describe GRPC::ActiveCall do
it 'the returns an enumerator that can read n responses' do it 'the returns an enumerator that can read n responses' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
finished_tag: done_tag, finished_tag: done_tag,
...@@ -271,8 +271,8 @@ describe GRPC::ActiveCall do ...@@ -271,8 +271,8 @@ describe GRPC::ActiveCall do
it 'the returns an enumerator that stops after an OK Status' do it 'the returns an enumerator that stops after an OK Status' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
read_metadata_tag: meta_tag, read_metadata_tag: meta_tag,
...@@ -296,8 +296,8 @@ describe GRPC::ActiveCall do ...@@ -296,8 +296,8 @@ describe GRPC::ActiveCall do
describe '#writes_done' do describe '#writes_done' do
it 'finishes ok if the server sends a status response' do it 'finishes ok if the server sends a status response' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
finished_tag: done_tag, finished_tag: done_tag,
...@@ -315,8 +315,8 @@ describe GRPC::ActiveCall do ...@@ -315,8 +315,8 @@ describe GRPC::ActiveCall do
it 'finishes ok if the server sends an early status response' do it 'finishes ok if the server sends an early status response' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
read_metadata_tag: meta_tag, read_metadata_tag: meta_tag,
...@@ -334,8 +334,8 @@ describe GRPC::ActiveCall do ...@@ -334,8 +334,8 @@ describe GRPC::ActiveCall do
it 'finishes ok if writes_done is true' do it 'finishes ok if writes_done is true' do
call = make_test_call call = make_test_call
done_tag, meta_tag = ActiveCall.client_start_invoke(call, @client_queue, done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
deadline) deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through, client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline, @pass_through, deadline,
read_metadata_tag: meta_tag, read_metadata_tag: meta_tag,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment