mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-26 19:35:12 +00:00
timer: add constructor from callback
This commit is contained in:
@@ -93,6 +93,8 @@ private:
|
||||
bool _queued = false;
|
||||
bool _expired = false;
|
||||
public:
|
||||
timer() = default;
|
||||
explicit timer(callback_t&& callback);
|
||||
~timer();
|
||||
future<> expired();
|
||||
void set_callback(callback_t&& callback);
|
||||
@@ -1443,6 +1445,11 @@ future<size_t> pollable_fd::sendto(socket_address addr, const void* buf, size_t
|
||||
});
|
||||
}
|
||||
|
||||
template <typename Clock>
|
||||
inline
|
||||
timer<Clock>::timer(callback_t&& callback) : _callback(std::move(callback)) {
|
||||
}
|
||||
|
||||
template <typename Clock>
|
||||
inline
|
||||
timer<Clock>::~timer() {
|
||||
|
||||
Reference in New Issue
Block a user