Forked from nicolasnoble/gist:a40a81db45db4f025601
Last active
August 29, 2015 14:25
-
-
Save chai2010/0e2c0c26a9de80e1c237 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment