Skip to main content

A grpc client for Flask.

Project description

A grpc client for Flask.

Usage

init

channel_wrapper = ChannelWrapper(
    target="gaea-partner-python-grpc-dev-cuwmnyhgmq-uc.a.run.app:443",
    secure=True,
    credentials=grpc.ssl_channel_credentials(),
)
channel_wrapper.init_app(app)

health_stub = StubWrapper(health_pb2_grpc.HealthStub, channel_wrapper)

views

@app.route("/grpc")
def grpc_api():
    reply = health_stub.Check(health_pb2.HealthCheckRequest())
    return f"grpc response: {reply}"

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

flask-grpc-0.1.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

flask_grpc-0.1.1-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

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