Fixes a event compiler error

pull/439/head
Tim Emiola 10 years ago
parent ee8f51fc8b
commit c3ac185491
  1. 11
      src/ruby/ext/grpc/rb_event.c
  2. 4
      src/ruby/spec/event_spec.rb

@ -256,14 +256,6 @@ static VALUE grpc_rb_event_result(VALUE self) {
event->data.finish_accepted); event->data.finish_accepted);
break; break;
case GRPC_INVOKE_ACCEPTED:
if (event->data.invoke_accepted == GRPC_OP_OK) {
return Qnil;
}
rb_raise(rb_eEventError, "invoke failed, not sure why (code=%d)",
event->data.invoke_accepted);
break;
case GRPC_WRITE_ACCEPTED: case GRPC_WRITE_ACCEPTED:
if (event->data.write_accepted == GRPC_OP_OK) { if (event->data.write_accepted == GRPC_OP_OK) {
return Qnil; return Qnil;
@ -343,9 +335,8 @@ void Init_google_rpc_event() {
rb_define_module_under(rb_mGoogleRpcCore, "CompletionType"); rb_define_module_under(rb_mGoogleRpcCore, "CompletionType");
rb_define_const(rb_mCompletionType, "QUEUE_SHUTDOWN", rb_define_const(rb_mCompletionType, "QUEUE_SHUTDOWN",
INT2NUM(GRPC_QUEUE_SHUTDOWN)); INT2NUM(GRPC_QUEUE_SHUTDOWN));
rb_define_const(rb_mCompletionType, "OP_COMPLETE", INT2NUM(GRPC_OP_COMPLETE));
rb_define_const(rb_mCompletionType, "READ", INT2NUM(GRPC_READ)); rb_define_const(rb_mCompletionType, "READ", INT2NUM(GRPC_READ));
rb_define_const(rb_mCompletionType, "INVOKE_ACCEPTED",
INT2NUM(GRPC_INVOKE_ACCEPTED));
rb_define_const(rb_mCompletionType, "WRITE_ACCEPTED", rb_define_const(rb_mCompletionType, "WRITE_ACCEPTED",
INT2NUM(GRPC_WRITE_ACCEPTED)); INT2NUM(GRPC_WRITE_ACCEPTED));
rb_define_const(rb_mCompletionType, "FINISH_ACCEPTED", rb_define_const(rb_mCompletionType, "FINISH_ACCEPTED",

@ -33,8 +33,8 @@ describe GRPC::Core::CompletionType do
before(:each) do before(:each) do
@known_types = { @known_types = {
QUEUE_SHUTDOWN: 0, QUEUE_SHUTDOWN: 0,
READ: 1, OP_COMPLETE: 1,
INVOKE_ACCEPTED: 2, READ: 2,
WRITE_ACCEPTED: 3, WRITE_ACCEPTED: 3,
FINISH_ACCEPTED: 4, FINISH_ACCEPTED: 4,
CLIENT_METADATA_READ: 5, CLIENT_METADATA_READ: 5,

Loading…
Cancel
Save