aboutsummaryrefslogtreecommitdiffhomepage
path: root/tdactor
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2022-06-27 02:57:56 +0300
committerlevlam <levlam@telegram.org>2022-06-27 02:57:56 +0300
commit513da45a8f375aa190b77e27430d77a3670ba8c6 (patch)
treefc475775f9b93fed675d4ef63ceec3e33176b33f /tdactor
parentaa97336963aea7e34e21c6fc2e5abfeed9246088 (diff)
Use free-standing function to create event promises.
Diffstat (limited to 'tdactor')
-rw-r--r--tdactor/td/actor/PromiseFuture.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/tdactor/td/actor/PromiseFuture.h b/tdactor/td/actor/PromiseFuture.h
index c27de952b..04b0509ed 100644
--- a/tdactor/td/actor/PromiseFuture.h
+++ b/tdactor/td/actor/PromiseFuture.h
@@ -399,6 +399,14 @@ class JoinPromise final : public PromiseInterface<Unit> {
};
} // namespace detail
+inline Promise<Unit> create_event_promise(EventFull &&ok) {
+ return Promise<Unit>(td::make_unique<detail::EventPromise>(std::move(ok)));
+}
+
+inline Promise<Unit> create_event_promise(EventFull ok, EventFull fail) {
+ return Promise<Unit>(td::make_unique<detail::EventPromise>(std::move(ok), std::move(fail)));
+}
+
class SendClosure {
public:
template <class... ArgsT>
@@ -663,14 +671,6 @@ class PromiseCreator {
std::move(cancellation_token), std::forward<OkT>(ok)));
}
- static Promise<> event(EventFull &&ok) {
- return Promise<>(td::make_unique<detail::EventPromise>(std::move(ok)));
- }
-
- static Promise<> event(EventFull ok, EventFull fail) {
- return Promise<>(td::make_unique<detail::EventPromise>(std::move(ok), std::move(fail)));
- }
-
template <class... ArgsT>
static Promise<> join(ArgsT &&...args) {
return Promise<>(td::make_unique<detail::JoinPromise<ArgsT...>>(std::forward<ArgsT>(args)...));