aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/node/ext')
-rw-r--r--src/node/ext/completion_queue_async_worker.cc16
-rw-r--r--src/node/ext/completion_queue_async_worker.h2
2 files changed, 7 insertions, 11 deletions
diff --git a/src/node/ext/completion_queue_async_worker.cc b/src/node/ext/completion_queue_async_worker.cc
index 4e57121a85..4be208c82d 100644
--- a/src/node/ext/completion_queue_async_worker.cc
+++ b/src/node/ext/completion_queue_async_worker.cc
@@ -63,7 +63,7 @@ CompletionQueueAsyncWorker::~CompletionQueueAsyncWorker() {}
void CompletionQueueAsyncWorker::Execute() {
result = grpc_completion_queue_next(queue, gpr_inf_future);
- if (result->data.op_complete != GRPC_OP_OK) {
+ if (!result.success) {
SetErrorMessage("The batch encountered an error");
}
}
@@ -96,25 +96,21 @@ void CompletionQueueAsyncWorker::HandleOKCallback() {
} else {
current_threads -= 1;
}
- NanCallback *callback = GetTagCallback(result->tag);
- Handle<Value> argv[] = {NanNull(), GetTagNodeValue(result->tag)};
+ NanCallback *callback = GetTagCallback(result.tag);
+ Handle<Value> argv[] = {NanNull(), GetTagNodeValue(result.tag)};
callback->Call(2, argv);
- DestroyTag(result->tag);
- grpc_event_finish(result);
- result = NULL;
+ DestroyTag(result.tag);
}
void CompletionQueueAsyncWorker::HandleErrorCallback() {
NanScope();
- NanCallback *callback = GetTagCallback(result->tag);
+ NanCallback *callback = GetTagCallback(result.tag);
Handle<Value> argv[] = {NanError(ErrorMessage())};
callback->Call(1, argv);
- DestroyTag(result->tag);
- grpc_event_finish(result);
- result = NULL;
+ DestroyTag(result.tag);
}
} // namespace node
diff --git a/src/node/ext/completion_queue_async_worker.h b/src/node/ext/completion_queue_async_worker.h
index 5d52bbb1fb..27fedf2fce 100644
--- a/src/node/ext/completion_queue_async_worker.h
+++ b/src/node/ext/completion_queue_async_worker.h
@@ -70,7 +70,7 @@ class CompletionQueueAsyncWorker : public NanAsyncWorker {
void HandleErrorCallback();
private:
- grpc_event *result;
+ grpc_event result;
static grpc_completion_queue *queue;