C++ embedded Python microservices
Project description
C++嵌入式Python微服务
C++ embedded Python microservices
1 简介
locapip是一个小型gRPC运行框架,适用于内嵌Python解释器的C++项目。
结合locapic,可与虚幻引擎项目优雅集成
2 服务端
2.1 安装
python -m pip install locapip
2.2 启动
python -m locapip --port 6547 --config CONFIG_JSON
其中,CONFIG_JSON
是配置文件的路径,定义启用的protobuf模块及其参数
{
"test": {},
"fit_fill": {},
"explorer": {
"working_directory": "d:/"
},
"your_protobuf_module": {
"path": "path/to/your_protobuf_module.py"
}
}
3 客户端
3.1 Python
TODO
3.2 C++
需结合C++接口locapic使用
locapic,借助pybind11的嵌入式Python解释器,提供了一套通用的C++接口使用locapip
TODO
4 自定义模块
服务端和客户端的具体实现方法,请参阅test.py
源码,以及 gRPC Python
和 Examples
服务端和客户端都应能够访问同一版本的protobuf模块,因此配置文件中定义的模块名称和路径应相同
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
locapip-0.1.15.tar.gz
(32.1 kB
view details)
Built Distribution
locapip-0.1.15-py3-none-any.whl
(42.3 kB
view details)
File details
Details for the file locapip-0.1.15.tar.gz
.
File metadata
- Download URL: locapip-0.1.15.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9f8751b46934c2716b6c5009f5f4d9957b714c60acaec0fd398a69d31641030 |
|
MD5 | dbd8d96b39f4e6715b457c4ea6b35d65 |
|
BLAKE2b-256 | c092cd12156eb4e199c51f811cd3feb9b1371562e599b78a587f5fb9bde45829 |
File details
Details for the file locapip-0.1.15-py3-none-any.whl
.
File metadata
- Download URL: locapip-0.1.15-py3-none-any.whl
- Upload date:
- Size: 42.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf4a2234e31e0ddeb63cdba327f3875cda5ecc7d595fdb23bf88e0a08dc3f37c |
|
MD5 | a84a82c716632522925feeb09f8a8a40 |
|
BLAKE2b-256 | e52003189526e0148eccaa0ea7e9022b655491086d2153236b0135078b565b97 |