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
0
votes
1 answer

How to interrupt a grpc call gracefully in the client side?

I wrote a client which starts multiple connections to a grpc server to request something. I want to stop all the other grpc call once I got a reply. I use an Event to control this process. However, I don't know how to terminate a grpc call…
mageover
  • 21
  • 4
0
votes
0 answers

gRPC generated code for Python 3 not working

protoc was generating invalid code in Python 3.8. I found that it works in Python 3.6. I followed the instructions as per: This fantastic blog The command I ran was: python -m grpc_tools.protoc --python_out=src/ --grpc_python_out=src/ --proto_path…
user2849678
  • 613
  • 7
  • 15
0
votes
0 answers

mitmproxy decode grpc response

i want to intercept requests using mitmproxy, but response is encode with grpc, this is my current code : from mitmproxy import http from mitmproxy import ctx class TestProxy: following = "Search" def response(self, flow: http.HTTPFlow) ->…
Lucian Blaga
  • 137
  • 2
  • 7
0
votes
0 answers

How to check if the user is listening on gRPC async stream from server

I have a server which is supposed to stream a set of endless data to the web client when client subscribes to it using grpc-web but my problem is that the server continues sending data even after user goes to some other page and leaves the streaming…
0
votes
1 answer

Python how to build dictionary from nested protobuf definitions

This is my first time working with grpc/protobuf tech. So far, so good I have coded grpc methods for simple (flat?) protobuf definitions. However I have run into nested protobuf declarations and have no idea how to formulate the dictionary payload.…
New2Python
  • 325
  • 1
  • 4
  • 17
0
votes
0 answers

gRPC "Socket closed" error in python client

my python client code is: def run(): try: channel = grpc.insecure_channel('api-auth.uid.ir') stub = session_api_pb2_grpc.SessionServiceStub(channel) response = stub.RegisterUserSession( …
sadng
  • 1
  • 1
  • 2
0
votes
0 answers

Django-grpc-framework generates strange gRPC code

When I generate gRPC code in my django-grpc-framework project using command: python -m grpc_tools.protoc --proto_path=./ --python_out=./temp --grpc_python_out=./temp ./config.proto something generates, but config_pb2 looks so empty: # -*- coding:…
0
votes
0 answers

Client could not find service in gRPC server

https://pastebin.com/7vqdrHyg greet.proto https://pastebin.com/4PYDYZ6Q greet_grpc.pb.go https://pastebin.com/2n6n8JjS greet_pb.go https://pastebin.com/FPpCJEGR main.go https://pastebin.com/CXuxG5fB handler/greet.go I have implemented a simple grpc…
disguisedtoast
  • 149
  • 1
  • 4
  • 15
0
votes
1 answer

How to send stream commit message in gRPC Python Client

I have a gRPC server on Go Lang and the client is in python. I have one RPC call in which the client initiates a progress stream and after completing the progress it sends a completion message to the server that the stream is finished. The problem…
0
votes
0 answers

How to keep bi-directional gRPC channel open from python client

I have defined a bi-dir gRPC streaming RPC for exchanging some configuration information with the server. Server: Implemented in C++ Client: Implemented in python 3.10 The client opens channel with server using…
paul
  • 1
  • 1
0
votes
1 answer

In gRPC python, the Service class and the Serve method are always in the same file, why?

In gRPC python, the Service-class and the Serve method are always in the same file, why? for example - the service class - link and the serve() - link Similarly - service-class and serve() I am new to python and grpc. In my project I wrote the serve…
Hasan
  • 1
  • 1
0
votes
0 answers

Change the clock type in condtion to monotonic in gRPC

We use gRPC in python to connect to external metrics collector, and we found in the timer thread in gRPC, the clocktype set in the condition is realtime type, what could I do to make it changed to monotonic? Thanks.
0
votes
0 answers

Create a tensor proto whose content is larger than 2GB for inference purposes

I am trying to get inferences from a model that is exposing a gRPC endpoint in a batch setting and a large batch size of about 10GB. I have instantiated a request object which I need to pass this batch data…
qboomerang
  • 1,931
  • 3
  • 15
  • 20
0
votes
1 answer

gRPC Unidirectional stream too chatty

I enabled GRPC_TRACE=all and GRPC_VERBOSITY=DEBUG in my python gRPC client. My server is written in Java. The client establishes a unidirectional stream connection with server and waits for the server to push messages onto it. This is my keep-alive…
Mohan
  • 61
  • 8
0
votes
1 answer

How does grpc-python maxworker work when handling request

I was wondered that how does python grpc maxworker work. If I set maxworker 10 grpc.server(futures.ThreadPoolExecutor(max_workers=int) Does it mean if I send 15 req to the grpc server, it will only handle 10 req at the same time(if my cpu num…