Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deep_proto-1.0.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

deep_proto-1.0.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file deep_proto-1.0.2.tar.gz.

File metadata

  • Download URL: deep_proto-1.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for deep_proto-1.0.2.tar.gz
Algorithm Hash digest
SHA256 fb3e88c33d6d943055dd90167493d29450a4148db8ecfcc7df0266d0ffc14df2
MD5 2b1b2da83a1747dc9746ea44a47cb475
BLAKE2b-256 05386e1ed171c0db64a6a59bcde57e9d0eb2e7612948b525e3853acea071dcf8

See more details on using hashes here.

File details

Details for the file deep_proto-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: deep_proto-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for deep_proto-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5bb9a9f6d3e6cfe01b3a01da1aa8ee5f38ce887d92410b1222147a4f2a91e941
MD5 65103fb0ab8a0ba2535fb1a9db9656e6
BLAKE2b-256 479c4da61345f3a91822a4ef59716b775c7603098bfe55d57406419686b3491b

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