xbot/irc_coroutine.cpp

21 lines
451 B
C++
Raw Normal View History

2025-01-23 12:46:52 -08:00
#include "irc_coroutine.hpp"
2025-01-25 15:45:31 -08:00
auto irc_coroutine::is_running() -> bool
{
2025-01-23 12:46:52 -08:00
return promise().connection_ != nullptr;
}
2025-01-25 15:45:31 -08:00
auto irc_coroutine::exception() -> std::exception_ptr
{
2025-01-23 12:46:52 -08:00
return promise().exception_;
}
2025-01-25 15:45:31 -08:00
auto irc_coroutine::start(Connection &connection) -> void
{
2025-01-23 12:46:52 -08:00
promise().connection_ = connection.shared_from_this();
resume();
}
2025-01-25 15:45:31 -08:00
void wait_ircmsg::stop() { ircmsg_slot_.disconnect(); }
2025-01-24 14:48:15 -08:00
2025-01-25 15:45:31 -08:00
void wait_timeout::stop() { timer_.reset(); }