Revert "Always use co-routines:"

This reverts commit 3d6e76046c.
This commit is contained in:
Tom Ritchford
2015-07-28 13:04:37 -04:00
committed by Nik Bougalis
parent 1dc3acb071
commit fa0a61b5d7
3 changed files with 26 additions and 6 deletions

View File

@@ -180,12 +180,24 @@ ServerHandlerImp::onRequest (HTTP::Session& session)
auto detach = session.detach();
RPC::SuspendCallback suspend (
[this, detach] (RPC::Suspend const& suspend) {
processSession (detach, suspend);
});
RPC::Coroutine coroutine (suspend);
coroutine.run();
if (setup_.yieldStrategy.useCoroutines ==
RPC::YieldStrategy::UseCoroutines::yes)
{
RPC::SuspendCallback suspend (
[this, detach] (RPC::Suspend const& suspend) {
processSession (detach, suspend);
});
RPC::Coroutine coroutine (suspend);
coroutine.run();
}
else
{
getApp().getJobQueue().addJob (
jtCLIENT, "RPC-Client",
[=] (Job&) {
processSession (detach, RPC::Suspend());
});
}
}
void