Skip to main content

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

启动服务

python -m locapip --port 6547 --proto PROTOBUF_DIR

其中,PROTOBUF_DIR是你的protobuf目录,应包含

PROTOBUF_DIR
    ├ example.py            服务端的实现,通常也包含客户端的实现
    ├ example_pb2.py        protobuf生成文件
    ├ example_pb2_grpc.py   grpc生成文件

2.2 实现

服务端在example.py中实现,请参阅 gRPC PythonExamples

3 客户端

3.1 Python

服务端和客户端都应能够访问同一版本的protobuf目录,在运行时import该目录下的所有模块,因此客户端也在example.py中实现。

3.2 C++

需结合C++接口locapic使用

locapic,借助pybind11的嵌入式Python解释器,提供了一套通用的C++接口使用locapip

TODO

Project details


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.8.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

locapip-0.1.8-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file locapip-0.1.8.tar.gz.

File metadata

  • Download URL: locapip-0.1.8.tar.gz
  • Upload date:
  • Size: 19.8 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

Hashes for locapip-0.1.8.tar.gz
Algorithm Hash digest
SHA256 bcff3bdb2983a6bdc0e9f4b2b811e803a9d2a7995b6fcf19984f93e1fd065cec
MD5 1b5d02614c9f7c6af220c66627093f6d
BLAKE2b-256 487e863862e8507f3c0879f0eb71a25b77353cbf65078d61438d1edc260c824f

See more details on using hashes here.

File details

Details for the file locapip-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: locapip-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 20.5 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

Hashes for locapip-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e434db6a649517a2205cc839dac252298c0fa2e920f083bf761340413e18b0e9
MD5 ed0972608d6b5fc2d2f15e2e2dabce27
BLAKE2b-256 d43ca289ec62bdf7cfb96fcdf5b6af5d6f9112d5a637d585094c6c9074e65116

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page