improvements
This commit is contained in:
parent
b2f992f5e4
commit
b944a28c38
@ -30,7 +30,7 @@ public:
|
||||
|
||||
void start(std::function<void(UVWError, Check &)> cb) noexcept {
|
||||
using CBF = CallbackFactory<void(uv_check_t *)>;
|
||||
auto func = CBF::on<&Check::startCallback>(*this, cb);
|
||||
auto func = CBF::on<&Check::startCallback>(*this, std::move(cb));
|
||||
auto err = uv_check_start(get<uv_check_t>(), func);
|
||||
if(err) { error(err); }
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public:
|
||||
|
||||
void start(std::function<void(UVWError, Idle &)> cb) noexcept {
|
||||
using CBF = CallbackFactory<void(uv_idle_t *)>;
|
||||
auto func = CBF::on<&Idle::startCallback>(*this, cb);
|
||||
auto func = CBF::on<&Idle::startCallback>(*this, std::move(cb));
|
||||
auto err = uv_idle_start(get<uv_idle_t>(), func);
|
||||
if(err) { error(err); }
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ public:
|
||||
|
||||
void start(std::function<void(UVWError, Prepare &)> cb) noexcept {
|
||||
using CBF = CallbackFactory<void(uv_prepare_t *)>;
|
||||
auto func = CBF::on<&Prepare::startCallback>(*this, cb);
|
||||
auto func = CBF::on<&Prepare::startCallback>(*this, std::move(cb));
|
||||
auto err = uv_prepare_start(get<uv_prepare_t>(), func);
|
||||
if(err) { error(err); }
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ public:
|
||||
typename Traits::Type addr;
|
||||
Traits::AddrFunc(ip.c_str(), port, &addr);
|
||||
using CBF = CallbackFactory<void(uv_connect_t *, int)>;
|
||||
auto func = CBF::template once<&Tcp::connectCallback>(*this, cb);
|
||||
auto func = CBF::template once<&Tcp::connectCallback>(*this, std::move(cb));
|
||||
auto err = uv_tcp_connect(conn.get(), get<uv_tcp_t>(), reinterpret_cast<const sockaddr *>(&addr), func);
|
||||
if(err) { error(err); }
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ public:
|
||||
|
||||
void start(const Time &timeout, const Time &rep, std::function<void(UVWError, Timer &)> cb) noexcept {
|
||||
using CBF = CallbackFactory<void(uv_timer_t *)>;
|
||||
auto func = CBF::on<&Timer::startCallback>(*this, cb);
|
||||
auto func = CBF::on<&Timer::startCallback>(*this, std::move(cb));
|
||||
auto err = uv_timer_start(get<uv_timer_t>(), func, timeout.count(), rep.count());
|
||||
if(err) { error(err); }
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user