|
|
@ -500,6 +500,26 @@ void Init_grpc_error_codes() { |
|
|
|
rb_obj_freeze(rb_error_code_details); |
|
|
|
rb_obj_freeze(rb_error_code_details); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Init_grpc_op_codes() { |
|
|
|
|
|
|
|
/* Constants representing operation type codes in grpc.h */ |
|
|
|
|
|
|
|
VALUE rb_CallOps = rb_define_module_under(rb_mGrpcCore, "CallOps"); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "SEND_INITIAL_METADATA", |
|
|
|
|
|
|
|
UINT2NUM(GRPC_OP_SEND_INITIAL_METADATA)); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "SEND_MESSAGE", UINT2NUM(GRPC_OP_SEND_MESSAGE)); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "SEND_CLOSE_FROM_CLIENT", |
|
|
|
|
|
|
|
UINT2NUM(GRPC_OP_SEND_CLOSE_FROM_CLIENT)); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "SEND_STATUS_FROM_SERVER", |
|
|
|
|
|
|
|
UINT2NUM(GRPC_OP_SEND_STATUS_FROM_SERVER)); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "RECV_INITIAL_METADATA", |
|
|
|
|
|
|
|
UINT2NUM(GRPC_OP_RECV_INITIAL_METADATA)); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "RECV_MESSAGE", |
|
|
|
|
|
|
|
UINT2NUM(GRPC_OP_RECV_MESSAGE)); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "RECV_STATUS_ON_CLIENT", |
|
|
|
|
|
|
|
UINT2NUM(GRPC_OP_RECV_STATUS_ON_CLIENT)); |
|
|
|
|
|
|
|
rb_define_const(rb_CallOps, "RECV_CLOSE_ON_SERVER", |
|
|
|
|
|
|
|
UINT2NUM(GRPC_OP_RECV_CLOSE_ON_SERVER)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Init_grpc_call() { |
|
|
|
void Init_grpc_call() { |
|
|
|
/* CallError inherits from Exception to signal that it is non-recoverable */ |
|
|
|
/* CallError inherits from Exception to signal that it is non-recoverable */ |
|
|
|
rb_eCallError = |
|
|
|
rb_eCallError = |
|
|
@ -543,6 +563,7 @@ void Init_grpc_call() { |
|
|
|
rb_define_const(rb_cCall, "INTERNAL_ALL_CALLs", hash_all_calls); |
|
|
|
rb_define_const(rb_cCall, "INTERNAL_ALL_CALLs", hash_all_calls); |
|
|
|
|
|
|
|
|
|
|
|
Init_grpc_error_codes(); |
|
|
|
Init_grpc_error_codes(); |
|
|
|
|
|
|
|
Init_grpc_op_codes(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Gets the call from the ruby object */ |
|
|
|
/* Gets the call from the ruby object */ |
|
|
|