diff --git a/lib/icingadb/redisconnection.cpp b/lib/icingadb/redisconnection.cpp index 6f9604b82..94db408d5 100644 --- a/lib/icingadb/redisconnection.cpp +++ b/lib/icingadb/redisconnection.cpp @@ -39,14 +39,14 @@ void RedisConnection::Start() if (!m_Started.exchange(true)) { Ptr keepAlive (this); - asio::spawn(m_Strand, [this, keepAlive](asio::yield_context yc) { ReadLoop(yc); }); - asio::spawn(m_Strand, [this, keepAlive](asio::yield_context yc) { WriteLoop(yc); }); + IoEngine::SpawnCoroutine(m_Strand, [this, keepAlive](asio::yield_context yc) { ReadLoop(yc); }); + IoEngine::SpawnCoroutine(m_Strand, [this, keepAlive](asio::yield_context yc) { WriteLoop(yc); }); } if (!m_Connecting.exchange(true)) { Ptr keepAlive (this); - asio::spawn(m_Strand, [this, keepAlive](asio::yield_context yc) { Connect(yc); }); + IoEngine::SpawnCoroutine(m_Strand, [this, keepAlive](asio::yield_context yc) { Connect(yc); }); } } diff --git a/lib/icingadb/redisconnection.hpp b/lib/icingadb/redisconnection.hpp index 8f8e5b10c..222e99cb3 100644 --- a/lib/icingadb/redisconnection.hpp +++ b/lib/icingadb/redisconnection.hpp @@ -10,7 +10,6 @@ #include "base/shared.hpp" #include "base/string.hpp" #include "base/value.hpp" -#include #include #include #include @@ -304,7 +303,7 @@ RedisConnection::Reply RedisConnection::ReadOne(StreamPtr& stream, boost::asio:: if (!m_Connecting.exchange(true)) { Ptr keepAlive (this); - asio::spawn(m_Strand, [this, keepAlive](asio::yield_context yc) { Connect(yc); }); + IoEngine::SpawnCoroutine(m_Strand, [this, keepAlive](asio::yield_context yc) { Connect(yc); }); } } @@ -342,7 +341,7 @@ void RedisConnection::WriteOne(StreamPtr& stream, RedisConnection::Query& query, if (!m_Connecting.exchange(true)) { Ptr keepAlive (this); - asio::spawn(m_Strand, [this, keepAlive](asio::yield_context yc) { Connect(yc); }); + IoEngine::SpawnCoroutine(m_Strand, [this, keepAlive](asio::yield_context yc) { Connect(yc); }); } }