notifications on request cancellation

This commit is contained in:
Konstantin Käfer
2014-09-17 12:10:08 +02:00
parent fd2b2e2082
commit 89cd310cf6
6 changed files with 68 additions and 21 deletions

View File

@@ -15,7 +15,17 @@ Request::~Request() {
assert(thread_id == uv_thread_self());
}
void Request::onload(Callback cb) {
void Request::onload(CompletedCallback cb) {
assert(thread_id == uv_thread_self());
if (base) {
Callback *callback = base->add(std::move(cb), base);
if (callback) {
callbacks.push_front(callback);
}
}
}
void Request::oncancel(AbortedCallback cb) {
assert(thread_id == uv_thread_self());
if (base) {
Callback *callback = base->add(std::move(cb), base);