added Request::cancel

This commit is contained in:
Michele Caini 2016-07-14 22:47:28 +02:00
parent 5f48173755
commit 78e6de086f

View File

@ -17,6 +17,15 @@ protected:
explicit Request(ResourceType<U> rt, std::shared_ptr<Loop> ref)
: Resource<T>{std::move(rt), std::move(ref)}
{ }
public:
void cancel() noexcept {
invoke(&uv_cancel, this->template get<uv_req_t>());
}
std::size_t size() const noexcept {
return uv_req_size(this->template get<uv_req_t>()->type);
}
};