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 is the client is initiating the stream and committing to every call. I want to send a completion message when the progress reaches 100%.
Here is my RPC call:
service DownloadClient{
rpc Progress (stream ProgressMessage) returns (google.protobuf.Empty);
}
message ProgressMessage{
double progress = 1;
}
The client code:
def sendProgress():
p = 0
while p <= 100:
sleep(1)
client.Progress(progressMessage(p).send(None))
p=p+1
def progressMessage(value=0):
prog = mypb.Progress(progress=value)
yield prog
sendProgress()