Merge pull request #122 from stanley-cheung/master

Grpc Updates
This commit is contained in:
Stanley Cheung 2017-12-14 23:07:06 -08:00 committed by GitHub
commit 34b57a4d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View File

@ -15,7 +15,7 @@ GrpcDecoder::GrpcDecoder()
GrpcDecoder::~GrpcDecoder() {}
Status GrpcDecoder::Decode() {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_core::ExecCtx exec_ctx;
for (const Slice& slice : *inputs()) {
if (slice.size() == 0) {
continue;
@ -32,7 +32,7 @@ Status GrpcDecoder::Decode() {
Status status(StatusCode::INVALID_ARGUMENT,
Format("Receives invalid compressed flag: %c.", c));
DEBUG("%s", status.error_message().c_str());
grpc_exec_ctx_finish(&exec_ctx);
return status;
}
compressed_flag_ = c;
@ -85,11 +85,11 @@ Status GrpcDecoder::Decode() {
grpc_slice_buffer output;
grpc_slice_buffer_init(&output);
if (grpc_msg_decompress(
&exec_ctx, grpc_compression_algorithm::GRPC_COMPRESS_GZIP,
&input, &output) != 1) {
grpc_compression_algorithm::GRPC_COMPRESS_GZIP, &input,
&output) != 1) {
grpc_slice_buffer_destroy(&input);
grpc_slice_buffer_destroy(&output);
grpc_exec_ctx_finish(&exec_ctx);
return Status(StatusCode::INTERNAL,
"Failed to uncompress the GRPC data frame.");
}
@ -115,7 +115,7 @@ Status GrpcDecoder::Decode() {
}
}
inputs()->clear();
grpc_exec_ctx_finish(&exec_ctx);
return Status::OK;
}
} // namespace gateway

View File

@ -20,7 +20,8 @@ GrpcEventQueue::~GrpcEventQueue() {}
void GrpcEventQueue::Start() {
gpr_thd_options thread_options = gpr_thd_options_default();
gpr_thd_options_set_joinable(&thread_options);
int ret = gpr_thd_new(&thread_id_, ExecuteEventLoop, this, &thread_options);
int ret = gpr_thd_new(&thread_id_, "grpc_event_queue", ExecuteEventLoop, this,
&thread_options);
INFO("GRPC event thread started: %d", ret);
}

2
third_party/grpc vendored

@ -1 +1 @@
Subproject commit 08aa228771c639a20e45e47120e1c667d8ac7344
Subproject commit dd1dbca2c3d4ace6da4eba008c3e279af024c7c6