Go to the source code of this file.
|
| TEST_F (ThreadedExecutorTest, example) |
|
| TEST_F (ThreadedExecutorTest, dtor_waits) |
|
| TEST_F (ThreadedExecutorTest, many) |
|
| TEST_F (ThreadedExecutorTest, many_sleeping_constant_time) |
|
| TEST_F (ThreadedExecutorTest, many_sleeping_decreasing_time) |
|
TEST_F |
( |
ThreadedExecutorTest |
, |
|
|
example |
|
|
) |
| |
Definition at line 29 of file ThreadedExecutorTest.cpp.
References EXPECT_EQ, folly::via(), and x.
32 .thenValue([&](
auto&&) {
return 42; })
33 .thenValue([&](
int n) {
return folly::to<std::string>(n); })
#define EXPECT_EQ(val1, val2)
auto via(Executor *x, Func &&func) -> Future< typename isFutureOrSemiFuture< decltype(std::declval< Func >()())>::Inner >
TEST_F |
( |
ThreadedExecutorTest |
, |
|
|
dtor_waits |
|
|
) |
| |
Definition at line 39 of file ThreadedExecutorTest.cpp.
References EXPECT_TRUE, and folly::via().
40 constexpr
auto kDelay = std::chrono::milliseconds(100);
41 auto x = std::make_unique<folly::ThreadedExecutor>();
43 std::this_thread::sleep_for(kDelay);
#define EXPECT_TRUE(condition)
auto via(Executor *x, Func &&func) -> Future< typename isFutureOrSemiFuture< decltype(std::declval< Func >()())>::Inner >
TEST_F |
( |
ThreadedExecutorTest |
, |
|
|
many |
|
|
) |
| |
Definition at line 50 of file ThreadedExecutorTest.cpp.
References folly::collect(), EXPECT_EQ, i, k, folly::gen::map(), folly::via(), and x.
51 constexpr
auto kNumTasks = 1024;
55 folly::gen::range<size_t>(0, kNumTasks) |
58 .thenValue([=](
auto&&) {
return i; })
59 .thenValue([](
size_t k) {
return folly::to<std::string>(
k); });
61 folly::gen::as<std::vector>())
#define EXPECT_EQ(val1, val2)
Map map(Predicate pred=Predicate())
Future< std::vector< typename std::iterator_traits< InputIterator >::value_type::value_type > > collect(InputIterator first, InputIterator last)
auto via(Executor *x, Func &&func) -> Future< typename isFutureOrSemiFuture< decltype(std::declval< Func >()())>::Inner >
TEST_F |
( |
ThreadedExecutorTest |
, |
|
|
many_sleeping_constant_time |
|
|
) |
| |
Definition at line 67 of file ThreadedExecutorTest.cpp.
References folly::collect(), EXPECT_EQ, i, k, folly::gen::map(), folly::via(), and x.
68 constexpr
auto kNumTasks = 256;
69 constexpr
auto kDelay = std::chrono::milliseconds(100);
73 folly::gen::range<size_t>(0, kNumTasks) |
76 .thenValue([=](
auto&&) {
77 std::this_thread::sleep_for(kDelay);
79 .thenValue([=](
auto&&) {
return i; })
80 .thenValue([](
size_t k) {
return folly::to<std::string>(
k); });
82 folly::gen::as<std::vector>())
#define EXPECT_EQ(val1, val2)
Map map(Predicate pred=Predicate())
Future< std::vector< typename std::iterator_traits< InputIterator >::value_type::value_type > > collect(InputIterator first, InputIterator last)
auto via(Executor *x, Func &&func) -> Future< typename isFutureOrSemiFuture< decltype(std::declval< Func >()())>::Inner >
TEST_F |
( |
ThreadedExecutorTest |
, |
|
|
many_sleeping_decreasing_time |
|
|
) |
| |
Definition at line 88 of file ThreadedExecutorTest.cpp.
References folly::collect(), EXPECT_EQ, i, k, folly::gen::map(), folly::via(), and x.
89 constexpr
auto kNumTasks = 256;
90 constexpr
auto kDelay = std::chrono::milliseconds(100);
94 folly::gen::range<size_t>(0, kNumTasks) |
97 .thenValue([=](
auto&&) {
98 auto delay = kDelay * (kNumTasks -
i) / kNumTasks;
99 std::this_thread::sleep_for(delay);
101 .thenValue([=](
auto&&) {
return i; })
102 .thenValue([](
size_t k) {
return folly::to<std::string>(
k); });
104 folly::gen::as<std::vector>())
#define EXPECT_EQ(val1, val2)
Map map(Predicate pred=Predicate())
Future< std::vector< typename std::iterator_traits< InputIterator >::value_type::value_type > > collect(InputIterator first, InputIterator last)
auto via(Executor *x, Func &&func) -> Future< typename isFutureOrSemiFuture< decltype(std::declval< Func >()())>::Inner >