Ruby progress

pull/1472/head
Craig Tiller 10 years ago
parent 7d95470a62
commit c7df2b8a56
  1. 9
      src/ruby/ext/grpc/rb_call.c

@ -581,7 +581,7 @@ static VALUE grpc_rb_call_run_batch(VALUE self, VALUE cqueue, VALUE tag,
VALUE timeout, VALUE ops_hash) { VALUE timeout, VALUE ops_hash) {
run_batch_stack st; run_batch_stack st;
grpc_call *call = NULL; grpc_call *call = NULL;
grpc_event *ev = NULL; grpc_event ev;
grpc_call_error err; grpc_call_error err;
VALUE result = Qnil; VALUE result = Qnil;
TypedData_Get_Struct(self, grpc_call, &grpc_call_data_type, call); TypedData_Get_Struct(self, grpc_call, &grpc_call_data_type, call);
@ -605,15 +605,14 @@ static VALUE grpc_rb_call_run_batch(VALUE self, VALUE cqueue, VALUE tag,
return Qnil; return Qnil;
} }
ev = grpc_rb_completion_queue_pluck_event(cqueue, tag, timeout); ev = grpc_rb_completion_queue_pluck_event(cqueue, tag, timeout);
if (ev == NULL) { if (ev.type == GRPC_QUEUE_TIMEOUT) {
grpc_run_batch_stack_cleanup(&st); grpc_run_batch_stack_cleanup(&st);
rb_raise(grpc_rb_eOutOfTime, "grpc_call_start_batch timed out"); rb_raise(grpc_rb_eOutOfTime, "grpc_call_start_batch timed out");
return Qnil; return Qnil;
} }
if (ev->data.op_complete != GRPC_OP_OK) { if (!ev.success) {
grpc_run_batch_stack_cleanup(&st); grpc_run_batch_stack_cleanup(&st);
rb_raise(grpc_rb_eCallError, "start_batch completion failed, (code=%d)", rb_raise(grpc_rb_eCallError, "start_batch completion failed");
ev->data.op_complete);
return Qnil; return Qnil;
} }

Loading…
Cancel
Save