From f5fb87ce85d2e9e149800e0dd9edca15f49ff858 Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:07:42 +0800 Subject: [PATCH] feat add Async interface --- src/sled/futures/future.h | 2 +- src/sled/futures/future_test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sled/futures/future.h b/src/sled/futures/future.h index 5bd6378..b874cec 100644 --- a/src/sled/futures/future.h +++ b/src/sled/futures/future.h @@ -346,7 +346,7 @@ public: return result; } - static Future AsyncWithValue(const T &value) noexcept + static Future AsyncValue(const T &value) noexcept { return Async([value]() { return value; }); } diff --git a/src/sled/futures/future_test.cc b/src/sled/futures/future_test.cc index 5f7af21..36ba3c9 100644 --- a/src/sled/futures/future_test.cc +++ b/src/sled/futures/future_test.cc @@ -113,7 +113,7 @@ TEST_SUITE("future") return 1; }); CHECK_FALSE(f2.IsFailed()); - auto f3 = sled::Future::AsyncWithValue("11"); + auto f3 = sled::Future::AsyncValue("11"); CHECK_EQ(f3.Result(), "11"); } }