DEEP Python Protobuf
Project description
Deep Proto
This is the generated code for the common APIs for DEEP. This is generated from the project intergra/deep-proto.
Usage
The usage of these packages differs between server and clients. Please see GRPC docs for more guidance.
Client
To use this as a client:
import grpc
from deepproto.proto.tracepoint.v1.tracepoint_pb2 import Snapshot
def pollServer()
# setup the connection channel
channel = grpc.secure_channel("deep:43315", grpc.ssl_channel_credentials())
# create stub service
stub = PollConfigStub(channel)
# create request
request = PollRequest()
# send request and await response
response = stub.poll(request)
def sendSnapshot()
# setup the connection channel
channel = grpc.secure_channel("deep:43315", grpc.ssl_channel_credentials())
# create stub service
stub = SnapshotServiceStub(channel)
# create grpc snapshot message
snapshot = Snapshot()
# send snapshot, and await response
response = stub.send(snapshot)
Server
To use this as a server:
import deepproto
import grpc
from deepproto.proto.poll.v1.poll_pb2 import PollResponse, ResponseType
from deepproto.proto.poll.v1.poll_pb2_grpc import PollConfigServicer
from deepproto.proto.tracepoint.v1.tracepoint_pb2 import TracePointConfig, SnapshotResponse
from deepproto.proto.tracepoint.v1.tracepoint_pb2_grpc import SnapshotServiceServicer
def serve():
# configure GRPC
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
# register the services
deepproto.proto.poll.v1.poll_pb2_grpc.add_PollConfigServicer_to_server(PollServicer(), server)
deepproto.proto.tracepoint.v1.tracepoint_pb2_grpc.add_SnapshotServiceServicer_to_server(SnapshotServicer(), server)
# start the server
server.add_insecure_port('[::]:43315')
server.start()
server.wait_for_termination()
class SnapshotServicer(SnapshotServiceServicer):
def send(self, request, context):
# Code to process a new snapshot
return SnapshotResponse()
class PollServicer(PollConfigServicer):
def poll(self, request, context):
# code to process a poll request
return PollResponse()
Documentation
The documentation for this project is available here.
Licensing
This project is licensed as AGPL-3.0-only.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deep_proto-1.0.5.tar.gz.
File metadata
- Download URL: deep_proto-1.0.5.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
824dfe74832f9b42977ad3fa3ed4ba6bc5a44458b5c8518d3a898d20f249f24d
|
|
| MD5 |
137c19ddf07d48c215dd5bcddadb0fe6
|
|
| BLAKE2b-256 |
1344803ec6f1d39c4a04aea75b7695ac712e25d91a391b74859b46755694df4a
|
File details
Details for the file deep_proto-1.0.5-py3-none-any.whl.
File metadata
- Download URL: deep_proto-1.0.5-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c667756df48b36d009368f3431af32db3a47dd2ced34185213c75ee0eee99e23
|
|
| MD5 |
960fb37f76138217f0261317a0b31034
|
|
| BLAKE2b-256 |
ea697674133a4723306a442a12d03da6d2d78246f48480fbe2740266c62f4375
|