Hi all,
I am facing some problems trying to close a Server-Stream call from the
client side.
The client opens the channel, create the stub, etc and try to perform the
call which returns an Iterator<Item>.
The grpc java examples show how to read the data from this Iterator is
using for example a while loop, but not how the client could close it (onle
the server can do so)
<code>
Iterator<Item> response = stub.getData()
while(response.hasNext())
{
response.next();
}
</code>
In case I want to close this call, what is the best way to do it? or at
least something that makes it works?
I have tried out something like this, whenever it goes out of the while
loop it will "destroy, cancel" the iterator, but it does not work:
<code>
Iterator<Item> response = stub.getData()
while(response.hasNext() && !condition)
{
response.next();
}
response = null;
</code>
Kind regards,
Rafael.
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/5bb6e241-f311-4379-9752-53e4d184cedf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.