Commit 24bc2447 authored by Dominik Charousset's avatar Dominik Charousset

Fix convenience functions on the resource types

parent f4e9dd83
...@@ -404,10 +404,10 @@ public: ...@@ -404,10 +404,10 @@ public:
return ctx->make_observable().from_resource(*this); return ctx->make_observable().from_resource(*this);
} }
/// Calls `try_open` and on success immediately calls `close` on the buffer. /// Calls `try_open` and on success immediately calls `cancel` on the buffer.
void close() { void cancel() {
if (auto buf = try_open()) if (auto buf = try_open())
buf->close(); buf->cancel();
} }
explicit operator bool() const noexcept { explicit operator bool() const noexcept {
...@@ -462,10 +462,10 @@ public: ...@@ -462,10 +462,10 @@ public:
} }
} }
/// Calls `try_open` and on success immediately calls `cancel` on the buffer. /// Calls `try_open` and on success immediately calls `close` on the buffer.
void cancel() { void close() {
if (auto buf = try_open()) if (auto buf = try_open())
buf->cancel(); buf->close();
} }
explicit operator bool() const noexcept { explicit operator bool() const noexcept {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment