user1522160
user1522160

Reputation: 59

Is grpc server response streaming still blocking?

I am using a python gRPC client and make request to a service that responds a stream. Last checked the document says the iterator.next() is sync and blocking. Have things changed now ? If not any ideas on overcoming this shortcoming ? Thanks Arvind

Upvotes: 1

Views: 2509

Answers (2)

alkasm
alkasm

Reputation: 22982

gRPC now has experimental asynchronous support for Python, and the documentation is here: https://grpc.github.io/grpc/python/grpc_asyncio.html. You can use an asynchronous iterator over the responses instead of making blocking reads with next(response_iterator).

Upvotes: 1

Things have not changed; as of 2018-03 the response iterator is still blocking.

We're currently scoping out remedies that may be ready later this year, but for the time being, calling next(response_iterator) is only way to draw RPC responses.

Upvotes: 1

Related Questions