Commit 774673fb authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

allow building python3 streaming on platforms without coroutines

Summary:
In order to use the Python 3 streaming thrift client on platforms that
don't support coroutines, conditionally define anything that depends
on coroutines.

Reviewed By: yfeldblum

Differential Revision: D21692900

fbshipit-source-id: 9f26d598097181ae43d1ff377a22b1c2f789321e
parent d65ffba7
......@@ -16,6 +16,10 @@
#pragma once
#include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/AsyncGenerator.h>
#include <folly/experimental/coro/Task.h>
......@@ -42,3 +46,5 @@ class AsyncGeneratorWrapper {
} // namespace python
} // namespace folly
#endif
......@@ -14,7 +14,7 @@
from folly.coro cimport cFollyCoroTask
cdef extern from "folly/experimental/coro/AsyncGenerator.h" namespace "folly::coro":
cdef extern from "folly/python/async_generator.h" namespace "folly::coro":
cdef cppclass cAsyncGenerator "folly::coro::AsyncGenerator"[T]:
pass
......
......@@ -23,6 +23,10 @@
#include <Python.h>
#include <folly/Executor.h>
#include <folly/Portability.h>
#if FOLLY_HAS_COROUTINES
#include <folly/experimental/coro/Task.h>
#include <folly/python/AsyncioExecutor.h>
#include <folly/python/executor.h>
......@@ -58,3 +62,5 @@ void bridgeCoroTask(
} // namespace python
} // namespace folly
#endif
......@@ -15,7 +15,7 @@
from cpython.ref cimport PyObject
from folly cimport cFollyExecutor, cFollyTry
cdef extern from "folly/experimental/coro/Task.h" namespace "folly::coro" nogil:
cdef extern from "folly/python/coro.h" namespace "folly::coro" nogil:
cdef cppclass cFollyCoroTask "folly::coro::Task"[T]:
pass
......
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