Commit 3e8a57cd authored by Nanshu Chen's avatar Nanshu Chen Committed by Facebook Github Bot

fix getExecutor redef error when both coro and futures are used

Summary: As both coro.h and futures.h defines the function getExecutor, redefinition error occurs when both of them are included. This change moves the getExecutor inline function to executor.h so it can be shared.

Reviewed By: yfeldblum

Differential Revision: D16676456

fbshipit-source-id: 33f7558a3d5dbc996c4efef4fe90918de32ad8b2
parent fd30521a
......@@ -24,16 +24,11 @@
#include <folly/Executor.h>
#include <folly/experimental/coro/Task.h>
#include <folly/python/AsyncioExecutor.h>
#include <folly/python/executor_api.h>
#include <folly/python/executor.h>
namespace folly {
namespace python {
inline folly::Executor* getExecutor() {
import_folly__executor();
return get_executor();
}
template <typename T>
void bridgeCoroTask(
folly::Executor* executor,
......
/*
* Copyright 2019-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <folly/python/executor_api.h>
namespace folly {
namespace python {
inline folly::Executor* getExecutor() {
import_folly__executor();
return get_executor();
}
} // namespace python
} // namespace folly
......@@ -24,16 +24,11 @@
#include <folly/Executor.h>
#include <folly/futures/Future.h>
#include <folly/python/AsyncioExecutor.h>
#include <folly/python/executor_api.h>
#include <folly/python/executor.h>
namespace folly {
namespace python {
inline folly::Executor* getExecutor() {
import_folly__executor();
return get_executor();
}
template <typename T>
void bridgeFuture(
folly::Executor* executor,
......
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