From the course: gRPC in Python

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Streaming server handler

Streaming server handler

From the course: gRPC in Python

Streaming server handler

- Let's look at the server code for handling streaming. So, we edit the track method. It gets the request_iterator in the context. We initialize count to zero and then we run a follow-up on the request_iterator. This one will get us one message after the other. We're not going to do much, we're just going to log that we got this request and then we are going to increment the count. Once we're out of the follow up, meaning the client is done streaming, we are going to return the response with the count of how many requests we got.

Contents