Skip to content

Instantly share code, notes, and snippets.

@nicolasnoble
Created June 26, 2015 04:32
Show Gist options
  • Save nicolasnoble/a40a81db45db4f025601 to your computer and use it in GitHub Desktop.
Save nicolasnoble/a40a81db45db4f025601 to your computer and use it in GitHub Desktop.
void HandleRpcs() {
new CallData(&service_, cq_.get());
void* tag;
bool ok;
while (true) {
switch (cq_->AsyncNext(&tag, &ok, gpr_inf_past) {
case TIMEOUT:
doSomethingElseForALittleWhile();
continue;
case SHUTDOWN:
return;
case GOT_EVENT:
GPR_ASSERT(ok);
static_cast<CallData*>(tag)->Proceed();
break;
}
}
}
@LuckyCloud
Copy link

what is gpr_inf_pash mean I can't find this var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment