Commit f5fb87ce authored by tqcq's avatar tqcq
Browse files

feat add Async interface

parent 07b79055
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -346,7 +346,7 @@ public:
        return result;
    }

    static Future<T, FailureT> AsyncWithValue(const T &value) noexcept
    static Future<T, FailureT> AsyncValue(const T &value) noexcept
    {
        return Async([value]() { return value; });
    }
+1 −1
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ TEST_SUITE("future")
            return 1;
        });
        CHECK_FALSE(f2.IsFailed());
        auto f3 = sled::Future<std::string>::AsyncWithValue("11");
        auto f3 = sled::Future<std::string>::AsyncValue("11");
        CHECK_EQ(f3.Result(), "11");
    }
}