Questions tagged [grpc-python]

Python implementation of gRPC: A high performance, open source, general RPC framework that puts mobile and HTTP/2 first.

gRPC is an open source remote procedure call (RPC) system initially developed at Google. It uses HTTP/2 for transport, Protocol Buffers as the interface description language, and provides features such as authentication, bidirectional streaming and flow control, blocking or nonblocking bindings, and cancellation and timeouts.

gRPC Basics - Python

401 questions
4
votes
0 answers

How should HTTP PATCH communicate the removal of resource attributes when using a FieldMask

TL,DR; How should HTTP PATCH communicate the removal of resource attributes when using a FieldMask? Google's API Design Guide for implementing standard methods states that a partial update should be achieved using a FieldMask. Below is my own…
Jack
  • 10,313
  • 15
  • 75
  • 118
4
votes
1 answer

how to end a server server stream from client grpc

I want to implement a method that can be called by the client to end the server streaming. Is there anything in grpc python or how can i implement that. In simple words I want the client to say "no longer streaming". Also, I want my server to not…
pri
  • 41
  • 4
4
votes
1 answer

Mapping gRPC error codes to HTTP error codes

My web-application makes HTTP requests to an Extensible Service Proxy (ESP), which in-turn, delegates to a gRPC server (written in Python). Ignoring Android and iOS clients, the architecture is: The ESP is a nginx reverse proxy. The gRPC server…
Jack
  • 10,313
  • 15
  • 75
  • 118
3
votes
2 answers

Can't use python gRPC rules in bazel - getting "Constraints from @bazel_tools//platforms have been removed" error

Trying to create a Python gRPC library, using gRPC v1.45.0 (upgrading could be complicated and also produced different issues; more on that in a moment). In my WORKSPACE, I have load("@com_github_grpc_grpc//bazel:grpc_deps.bzl",…
wrp
  • 99
  • 6
3
votes
0 answers

"grpc_message":"Stream removed","grpc_status":2

I am running a python grpc server and using envoy to connect to it through client. The envoy is deployed in GKE. I am attaching the envoy deployment yaml. apiVersion: apps/v1 kind: Deployment metadata: name: envoy-deployment labels: app:…
ak1234
  • 201
  • 2
  • 10
3
votes
3 answers

GRPC_TOOLS.PROTOC generates broken pb2 python file

I am trying to build an application using gRPC in Python. I have the following directory layout: service/ ├─ auth/ │ ├─ auth_pb2_grpc.py │ ├─ auth_pb2.py │ ├─ auth.py │ ├─ client.py ├─ flask/ ├─ todo/ ├─ app.py ├─ auth.proto/ ├─…
Qagan
  • 31
  • 3
3
votes
2 answers

can protocol buffer be used without gRPC?

Hello everyone I am getting my hands dirty with gRPC and protocol buffers and have came across an article which has mentioned that the binary protobuf file for a message is 5 times smaller than Json counterpart but in that article it is mentioned…
JayD
  • 748
  • 1
  • 13
  • 38
3
votes
1 answer

how to call knative service [grpc server] by using a python client

I have created a knative service[gRPC server] in aks cluster, I have exposed the service using istio gateway private static IP, After using the command kubectl get ksvc I have got an address sample-app.test.10.153.157.156.sslio.io When I try to use…
3
votes
0 answers

Cythonized async python gRPC server not working

I have to cythonize a python script which contains an asyncio gRPC server. The script is working well when is running with Python. I've written a non asyncio version of the script and both python and cythonized variants are working without any…
Slava Zhuyko
  • 691
  • 4
  • 12
3
votes
0 answers

content-type not being set properly

I am working on implementing the gRPC generated code for the flatbuffers library, and I've noticed that the python gRPC library doesn't use the user set content-type. According to the documentation the user can set whatever type they want in the…
3
votes
2 answers

grpc python measure response time

How can I measure the full time grpc-python takes to handle a request? So far the best I can do is: def Run(self, request, context): start = time.time() # service code... end = time.time() return myservice_stub.Response() But this…
user3599803
  • 6,435
  • 17
  • 69
  • 130
3
votes
1 answer

gRPC API server via Python can't worked

I have developed the gRPC API server via Python, Then build it to container and deploy on Cloud Run, Which my gRPC server are integrating with TensorFlow application. Actually the tensorflow for image ML, but this is a example code for instance to…
zzob
  • 993
  • 3
  • 9
  • 19
3
votes
0 answers

How to achieve server-side bidirectional flow timeout on message receive in gRPC Python?

Client send message to the Hello method which is bidirectional flow in grpc service. Server receive the message from client and reply the HelloReply(). Here is what I would like to do: If server does not receive any message from client within 2…
3
votes
0 answers

how to implement client to a grpc-inflection enabled server using python?

my goal is to implement a gRPC client that is unfamiliar of the proto file (only knows server/service port number) - the client find the service on run-time (reflection) my client should be able to: connect to the server learn which server…
3
votes
1 answer

Allow repeated field in gRPC Transcoding

I'm using gRPC in Google CLoud Endpoints I'm using quick example for endpoint python I addition one function for SayHelloRepeated but don't know how to transcode repeated field. helloworld.proto service Greeter { ... rpc SayHelloRepeated…