Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/backends/nntpchan-daemon/libnntpchan/event.cpp

18 lines
336 B
C++
Raw Normal View History

2016-10-15 18:12:01 +05:00
#include <cassert>
2017-10-17 19:29:56 +05:00
#include <nntpchan/event.hpp>
2016-10-15 18:12:01 +05:00
namespace nntpchan
{
2017-10-17 19:29:56 +05:00
Mainloop::Mainloop()
{
m_loop = uv_default_loop();
assert(uv_loop_init(m_loop) == 0);
}
2016-10-15 18:12:01 +05:00
2017-10-17 19:29:56 +05:00
Mainloop::~Mainloop() { uv_loop_close(m_loop); }
2016-10-15 18:12:01 +05:00
2017-10-17 19:29:56 +05:00
void Mainloop::Stop() { uv_stop(m_loop); }
2017-05-03 18:44:42 +05:00
2017-10-17 19:29:56 +05:00
void Mainloop::Run(uv_run_mode mode) { assert(uv_run(m_loop, mode) == 0); }
2016-10-15 18:12:01 +05:00
}