mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
Merge branch 'bye-bye-completion-queue-pie' into we-dont-need-no-backup
This commit is contained in:
commit
775ebf37f3
@ -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
|
||||
|
||||
@ -70,7 +70,7 @@ class CompletionQueueAsyncWorker : public NanAsyncWorker {
|
||||
void HandleErrorCallback();
|
||||
|
||||
private:
|
||||
grpc_event *result;
|
||||
grpc_event result;
|
||||
|
||||
static grpc_completion_queue *queue;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user