Commit 54b8e62e authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

guard coro code consistently

Summary: Choose a single strategy for guarding coro files. Namely, all includes are unconditional, but otherwise the bodies of all headers, sources, and tests are conditional.

Reviewed By: ericniebler

Differential Revision: D26647625

fbshipit-source-id: 33eeb12fb231bd7ae7fe5cb97ead16ab017b15f5
parent c3d71b54
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Accumulate.h> #include <folly/experimental/coro/Accumulate.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
namespace { namespace {
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Task.h> #include <folly/experimental/coro/Task.h>
...@@ -28,6 +26,8 @@ ...@@ -28,6 +26,8 @@
#include <exception> #include <exception>
#if FOLLY_HAS_COROUTINES
struct SomeError : std::exception {}; struct SomeError : std::exception {};
BENCHMARK(asyncGeneratorThrowError, iters) { BENCHMARK(asyncGeneratorThrowError, iters) {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/Traits.h> #include <folly/Traits.h>
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
...@@ -37,6 +35,8 @@ ...@@ -37,6 +35,8 @@
#include <string> #include <string>
#include <tuple> #include <tuple>
#if FOLLY_HAS_COROUTINES
class AsyncGeneratorTest : public testing::Test {}; class AsyncGeneratorTest : public testing::Test {};
TEST_F(AsyncGeneratorTest, DefaultConstructedGeneratorIsEmpty) { TEST_F(AsyncGeneratorTest, DefaultConstructedGeneratorIsEmpty) {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/AsyncPipe.h> #include <folly/experimental/coro/AsyncPipe.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
...@@ -27,6 +25,8 @@ ...@@ -27,6 +25,8 @@
#include <string> #include <string>
#if FOLLY_HAS_COROUTINES
TEST(AsyncPipeTest, PublishConsume) { TEST(AsyncPipeTest, PublishConsume) {
auto pipe = folly::coro::AsyncPipe<int>::create(); auto pipe = folly::coro::AsyncPipe<int>::create();
for (int i = 0; i < 5; ++i) { for (int i = 0; i < 5; ++i) {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncScope.h> #include <folly/experimental/coro/AsyncScope.h>
#include <folly/executors/GlobalExecutor.h> #include <folly/executors/GlobalExecutor.h>
...@@ -28,6 +26,8 @@ ...@@ -28,6 +26,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
struct AsyncScopeTest : public testing::Test {}; struct AsyncScopeTest : public testing::Test {};
TEST_F(AsyncScopeTest, ConstructDestruct) { TEST_F(AsyncScopeTest, ConstructDestruct) {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncStack.h> #include <folly/experimental/coro/AsyncStack.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
...@@ -32,6 +30,8 @@ ...@@ -32,6 +30,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
class AsyncStackTest : public testing::Test {}; class AsyncStackTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
#include <folly/experimental/coro/Task.h> #include <folly/experimental/coro/Task.h>
...@@ -25,6 +23,8 @@ ...@@ -25,6 +23,8 @@
#include <stdio.h> #include <stdio.h>
#if FOLLY_HAS_COROUTINES
using namespace folly; using namespace folly;
class BatonTest : public testing::Test {}; class BatonTest : public testing::Test {};
......
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Utils.h> #include <folly/experimental/coro/Utils.h>
#include <string> #include <string>
#if FOLLY_HAS_COROUTINES
BENCHMARK(blockingWaitRVOInt, iters) { BENCHMARK(blockingWaitRVOInt, iters) {
for (size_t iter = 0; iter < iters; ++iter) { for (size_t iter = 0; iter < iters; ++iter) {
auto result = auto result =
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/Optional.h> #include <folly/Optional.h>
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
...@@ -32,6 +30,8 @@ ...@@ -32,6 +30,8 @@
#include <memory> #include <memory>
#include <type_traits> #include <type_traits>
#if FOLLY_HAS_COROUTINES
static_assert( static_assert(
std::is_same< std::is_same<
decltype(folly::coro::blockingWait( decltype(folly::coro::blockingWait(
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/executors/CPUThreadPoolExecutor.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
...@@ -35,6 +33,8 @@ ...@@ -35,6 +33,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#if FOLLY_HAS_COROUTINES
folly::coro::Task<void> sleepThatShouldBeCancelled( folly::coro::Task<void> sleepThatShouldBeCancelled(
std::chrono::milliseconds dur) { std::chrono::milliseconds dur) {
EXPECT_THROW(co_await folly::coro::sleep(dur), folly::OperationCancelled); EXPECT_THROW(co_await folly::coro::sleep(dur), folly::OperationCancelled);
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Concat.h> #include <folly/experimental/coro/Concat.h>
#include <folly/experimental/coro/Task.h> #include <folly/experimental/coro/Task.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
namespace { namespace {
......
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#if FOLLY_HAS_COROUTINES
#include <experimental/coroutine>
#include <future> #include <future>
#include <folly/experimental/coro/Coroutine.h>
#if FOLLY_HAS_COROUTINES
class Wait { class Wait {
public: public:
class promise_type { class promise_type {
......
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
*/ */
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/experimental/coro/Coroutine.h>
#include <future>
#include <thread> #include <thread>
struct ExpensiveCopy { struct ExpensiveCopy {
...@@ -26,8 +30,6 @@ struct ExpensiveCopy { ...@@ -26,8 +30,6 @@ struct ExpensiveCopy {
}; };
#if FOLLY_HAS_COROUTINES #if FOLLY_HAS_COROUTINES
#include <experimental/coroutine>
#include <future>
class Wait { class Wait {
public: public:
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/CancellationToken.h> #include <folly/CancellationToken.h>
#include <folly/Chrono.h> #include <folly/Chrono.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
...@@ -37,6 +35,8 @@ ...@@ -37,6 +35,8 @@
#include <folly/io/async/ScopedEventBaseThread.h> #include <folly/io/async/ScopedEventBaseThread.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly; using namespace folly;
class CoroTest : public testing::Test {}; class CoroTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Collect.h> #include <folly/experimental/coro/Collect.h>
#include <folly/experimental/coro/CurrentExecutor.h> #include <folly/experimental/coro/CurrentExecutor.h>
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
class CoRescheduleOnCurrentExecutorTest : public testing::Test {}; class CoRescheduleOnCurrentExecutorTest : public testing::Test {};
TEST_F(CoRescheduleOnCurrentExecutorTest, example) { TEST_F(CoRescheduleOnCurrentExecutorTest, example) {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/CurrentExecutor.h> #include <folly/experimental/coro/CurrentExecutor.h>
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
class DematerializeTest : public testing::Test {}; class DematerializeTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Result.h> #include <folly/experimental/coro/Result.h>
#include <type_traits> #include <type_traits>
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
#include <folly/Utility.h> #include <folly/Utility.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
class CoErrorTest : public testing::Test {}; class CoErrorTest : public testing::Test {};
TEST_F(CoErrorTest, constructible) { TEST_F(CoErrorTest, constructible) {
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Filter.h> #include <folly/experimental/coro/Filter.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
class FilterTest : public testing::Test {}; class FilterTest : public testing::Test {};
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
...@@ -25,6 +24,8 @@ ...@@ -25,6 +24,8 @@
#include <folly/experimental/coro/Task.h> #include <folly/experimental/coro/Task.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
static folly::coro::Task<int> makeTask() { static folly::coro::Task<int> makeTask() {
co_return 42; co_return 42;
} }
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/experimental/coro/Generator.h> #include <folly/experimental/coro/Generator.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <algorithm> #include <algorithm>
#if FOLLY_HAS_COROUTINES
namespace folly { namespace folly {
namespace coro { namespace coro {
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#include <gtest/gtest-death-test.h> #include <gtest/gtest-death-test.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/GmockHelpers.h> #include <folly/experimental/coro/GmockHelpers.h>
...@@ -30,6 +29,8 @@ ...@@ -30,6 +29,8 @@
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace ::testing; using namespace ::testing;
using namespace folly::coro::gmock_helpers; using namespace folly::coro::gmock_helpers;
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/detail/InlineTask.h> #include <folly/experimental/coro/detail/InlineTask.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <tuple> #include <tuple>
#if FOLLY_HAS_COROUTINES
template <typename T> template <typename T>
using InlineTask = folly::coro::detail::InlineTask<T>; using InlineTask = folly::coro::detail::InlineTask<T>;
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/CurrentExecutor.h> #include <folly/experimental/coro/CurrentExecutor.h>
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
class MaterializeTest : public testing::Test {}; class MaterializeTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/CancellationToken.h> #include <folly/CancellationToken.h>
#include <folly/ScopeGuard.h> #include <folly/ScopeGuard.h>
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
...@@ -30,6 +28,8 @@ ...@@ -30,6 +28,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
class MergeTest : public testing::Test {}; class MergeTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/CurrentExecutor.h> #include <folly/experimental/coro/CurrentExecutor.h>
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
class MultiplexTest : public testing::Test {}; class MultiplexTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/executors/CPUThreadPoolExecutor.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
...@@ -29,6 +27,8 @@ ...@@ -29,6 +27,8 @@
#include <mutex> #include <mutex>
#if FOLLY_HAS_COROUTINES
using namespace folly; using namespace folly;
class MutexTest : public testing::Test {}; class MutexTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Retry.h> #include <folly/experimental/coro/Retry.h>
#include <folly/experimental/coro/Sleep.h> #include <folly/experimental/coro/Sleep.h>
...@@ -27,6 +25,8 @@ ...@@ -27,6 +25,8 @@
#include <chrono> #include <chrono>
#include <exception> #include <exception>
#if FOLLY_HAS_COROUTINES
using namespace std::chrono_literals; using namespace std::chrono_literals;
namespace { namespace {
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/executors/CPUThreadPoolExecutor.h> #include <folly/executors/CPUThreadPoolExecutor.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
...@@ -28,6 +26,8 @@ ...@@ -28,6 +26,8 @@
#include <mutex> #include <mutex>
#if FOLLY_HAS_COROUTINES
using namespace folly; using namespace folly;
class SharedMutexTest : public testing::Test {}; class SharedMutexTest : public testing::Test {};
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/CurrentExecutor.h> #include <folly/experimental/coro/CurrentExecutor.h>
#include <folly/experimental/coro/Task.h> #include <folly/experimental/coro/Task.h>
#include <memory> #include <memory>
#if FOLLY_HAS_COROUTINES
BENCHMARK(SingleVoidSynchronousTaskInLoop, iters) { BENCHMARK(SingleVoidSynchronousTaskInLoop, iters) {
folly::coro::blockingWait([iters]() -> folly::coro::Task<void> { folly::coro::blockingWait([iters]() -> folly::coro::Task<void> {
auto completeSynchronously = []() -> folly::coro::Task<void> { co_return; }; auto completeSynchronously = []() -> folly::coro::Task<void> { co_return; };
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/executors/InlineExecutor.h> #include <folly/executors/InlineExecutor.h>
#include <folly/executors/ManualExecutor.h> #include <folly/executors/ManualExecutor.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
...@@ -32,6 +30,8 @@ ...@@ -32,6 +30,8 @@
#include <type_traits> #include <type_traits>
#if FOLLY_HAS_COROUTINES
using namespace folly; using namespace folly;
static_assert( static_assert(
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Collect.h> #include <folly/experimental/coro/Collect.h>
#include <folly/experimental/coro/Sleep.h> #include <folly/experimental/coro/Sleep.h>
...@@ -28,6 +26,8 @@ ...@@ -28,6 +26,8 @@
#include <chrono> #include <chrono>
#include <stdexcept> #include <stdexcept>
#if FOLLY_HAS_COROUTINES
using namespace std::chrono_literals; using namespace std::chrono_literals;
using namespace folly; using namespace folly;
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Traits.h> #include <folly/experimental/coro/Traits.h>
#include <experimental/coroutine> #include <experimental/coroutine>
#include <type_traits> #include <type_traits>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
template <typename T> template <typename T>
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/CancellationToken.h> #include <folly/CancellationToken.h>
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
...@@ -29,6 +27,8 @@ ...@@ -29,6 +27,8 @@
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
class TransformTest : public testing::Test {}; class TransformTest : public testing::Test {};
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/CancellationToken.h> #include <folly/CancellationToken.h>
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Collect.h> #include <folly/experimental/coro/Collect.h>
...@@ -28,6 +26,8 @@ ...@@ -28,6 +26,8 @@
#include <string> #include <string>
#include <thread> #include <thread>
#if FOLLY_HAS_COROUTINES
TEST(UnboundedQueueTest, EnqueueDeque) { TEST(UnboundedQueueTest, EnqueueDeque) {
folly::coro::UnboundedQueue<std::string, true, true> queue; folly::coro::UnboundedQueue<std::string, true, true> queue;
constexpr auto val = "a string"; constexpr auto val = "a string";
......
...@@ -28,10 +28,8 @@ ...@@ -28,10 +28,8 @@
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Sleep.h> #include <folly/experimental/coro/Sleep.h>
#include <folly/fibers/async/Task.h> #include <folly/fibers/async/Task.h>
#endif
using namespace ::testing; using namespace ::testing;
using namespace folly::fibers; using namespace folly::fibers;
......
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
#include <folly/io/coro/ServerSocket.h> #include <folly/io/coro/ServerSocket.h>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
namespace { namespace {
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include <folly/io/coro/Socket.h> #include <folly/io/coro/Socket.h>
#include <optional> #include <optional>
#if FOLLY_HAS_COROUTINES
namespace folly { namespace folly {
namespace coro { namespace coro {
...@@ -62,3 +64,5 @@ class ServerSocket { ...@@ -62,3 +64,5 @@ class ServerSocket {
} // namespace coro } // namespace coro
} // namespace folly } // namespace folly
#endif // FOLLY_HAS_COROUTINES
...@@ -16,11 +16,12 @@ ...@@ -16,11 +16,12 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Baton.h> #include <folly/experimental/coro/Baton.h>
#include <folly/io/coro/Socket.h> #include <folly/io/coro/Socket.h>
#include <functional> #include <functional>
#if FOLLY_HAS_COROUTINES
using namespace folly::coro; using namespace folly::coro;
namespace { namespace {
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <folly/io/async/AsyncSocket.h> #include <folly/io/async/AsyncSocket.h>
#include <folly/io/async/AsyncTimeout.h> #include <folly/io/async/AsyncTimeout.h>
#if FOLLY_HAS_COROUTINES
namespace folly { namespace folly {
namespace coro { namespace coro {
...@@ -150,3 +152,5 @@ class Socket : public Transport { ...@@ -150,3 +152,5 @@ class Socket : public Transport {
} // namespace coro } // namespace coro
} // namespace folly } // namespace folly
#endif // FOLLY_HAS_COROUTINES
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/BlockingWait.h> #include <folly/experimental/coro/BlockingWait.h>
#include <folly/experimental/coro/Collect.h> #include <folly/experimental/coro/Collect.h>
#include <folly/io/async/test/AsyncSocketTest.h> #include <folly/io/async/test/AsyncSocketTest.h>
...@@ -26,6 +24,8 @@ ...@@ -26,6 +24,8 @@
#include <folly/io/coro/Socket.h> #include <folly/io/coro/Socket.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#if FOLLY_HAS_COROUTINES
using namespace std::chrono_literals; using namespace std::chrono_literals;
using namespace folly; using namespace folly;
using namespace folly::coro; using namespace folly::coro;
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncGenerator.h> #include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/Task.h> #include <folly/experimental/coro/Task.h>
#if FOLLY_HAS_COROUTINES
namespace folly { namespace folly {
namespace python { namespace python {
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
#include <folly/Executor.h> #include <folly/Executor.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Task.h> #include <folly/experimental/coro/Task.h>
#include <folly/python/AsyncioExecutor.h> #include <folly/python/AsyncioExecutor.h>
#include <folly/python/executor.h> #include <folly/python/executor.h>
#if FOLLY_HAS_COROUTINES
namespace folly { namespace folly {
namespace python { namespace python {
......
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