All calls to/from python are performed on one thread via a simple message queue (necessary because of the global interpreter lock).
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "python_interop/execution/execution_gateway.h"
|
|
#include "python_interop/execution/execution_gateway_bridge.h"
|
|
#include "python_interop/md/md_bridge.h"
|
|
#include "python_interop/md/md_provider.h"
|
|
#include "python_interop/python_object.h"
|
|
|
|
#include <functional>
|
|
#include <future>
|
|
#include <memory>
|
|
#include <pybind11/pytypes.h>
|
|
#include <string>
|
|
|
|
namespace python_interop {
|
|
|
|
class PluginManager {
|
|
void *me_;
|
|
|
|
public:
|
|
PluginManager();
|
|
~PluginManager();
|
|
|
|
void start_work_thread();
|
|
void stop_work_thread();
|
|
|
|
std::future<std::shared_ptr<PythonObjectT<bts::md::py_interop::MdProvider>>>
|
|
start_md_provider(
|
|
std::string provider_name,
|
|
std::string target,
|
|
std::shared_ptr<bts::md::py_interop::MdBridge> bridge);
|
|
void stop_md_provider(const std::string &provider_name);
|
|
|
|
std::future<
|
|
std::shared_ptr<PythonObjectT<python_execution::ExecutionGateway>>>
|
|
start_execution_gateway(
|
|
std::string gateway_name,
|
|
std::string target,
|
|
std::shared_ptr<python_execution::ExecutionGatewayBridge> bridge);
|
|
void stop_execution_gateway(const std::string &gateway_name);
|
|
|
|
void invoke(std::function<void()> callback);
|
|
};
|
|
|
|
} // namespace python_interop
|