IoEngine#SpawnCoroutine(): remove redundand overload

This commit is contained in:
Alexander A. Klimov 2020-02-05 15:31:57 +01:00
parent d98493c90f
commit 0ed0f73d9d
1 changed files with 0 additions and 23 deletions

View File

@ -114,7 +114,6 @@ public:
#endif /* _WIN32 */
}
/* With dedicated strand in *Connection classes. */
template <typename Handler, typename Function>
static void SpawnCoroutine(Handler& h, Function f) {
@ -136,28 +135,6 @@ public:
);
}
/* Without strand in the IO executor's context. */
template <typename Function>
static void SpawnCoroutine(boost::asio::io_context& io, Function f) {
boost::asio::spawn(io,
[f](boost::asio::yield_context yc) {
try {
f(yc);
} catch (const boost::coroutines::detail::forced_unwind &) {
// Required for proper stack unwinding when coroutines are destroyed.
// https://github.com/boostorg/coroutine/issues/39
throw;
} catch (...) {
// Handle uncaught exceptions outside of the coroutine.
rethrowBoostExceptionPointer();
}
},
boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size.
);
}
private:
IoEngine();