Josh/Chaitanya, I have a similar application - are there any C++ examples 
that do this kind of thing?  I just posted a new question to the newsgroup 
asking and then I found this thread.

John

On Friday, January 22, 2016 at 4:53:42 PM UTC-5, Josh Humphries wrote:
>
> There is an example of streaming, at least in a proto file:
>
> https://github.com/grpc/grpc/blob/master/examples/protos/hellostreamingworld.proto
> In this case, the server is expected to just immediately send the 
> requested number of messages.
>
>
> Assuming you had some "registry" of streams that represent clients to 
> which you forward data:
>
> In your server implementation, you'd just register the StreamObserver 
> (that's what its called in the Java runtime 
> <https://github.com/grpc/grpc-java/blob/master/stub/src/main/java/io/grpc/stub/StreamObserver.java>
>  
> anyway).
>
> Here's example generated code for an endpoint with a streaming response: 
> https://github.com/grpc/grpc-java/blob/master/examples/src/generated/main/grpc/io/grpc/examples/routeguide/RouteGuideGrpc.java#L80
> (That's the interface you implement on the server.)
>
> When your server receives data from whatever other source, it can consult 
> this registry of streams and then call onNext to send the client(s) data. 
> Unregister when the stream errors or when you close the stream. You close 
> it via calling onComplete or onError (latter will send error code to the 
> client).
>
>
>
> ----
> *Josh Humphries*
> Manager, Shared Systems  |  Platform Engineering
> Atlanta, GA  |  678-400-4867
> *Square* (www.squareup.com)
>
> On Fri, Jan 22, 2016 at 3:51 PM, Chaitanya Gangwar <[email protected] 
> <javascript:>> wrote:
>
>> Thanks josh for the reply. So for this case i need both async server and 
>> client. sync rpc will not work. please correct me if i am wrong. also do we 
>> have any example which i can look into. i checked async helloworld but that 
>> is simple rpc do we have any example for async stream rpc.
>>
>> On Friday, 22 January 2016 12:28:18 UTC-8, Chaitanya Gangwar wrote:
>>>
>>> Hi,
>>>
>>> I have a requirement, where  multiple clients send (register) a request 
>>> to server and continue, whenever server have data, server will push the 
>>> data to clients. it may be possible that server may not have data at 
>>> present and will keep pushing data whenever it has. Some other thread is 
>>> providing the data to server. 
>>>
>>> Can i do this with grpc without blocking the server and client. What i 
>>> understand from grpc streaming is that client will be waiting for data till 
>>> server sends out the data and after receiving the data it closes the 
>>> connection.
>>>
>>> please help, if i can do this using grpc and if yes how should i design 
>>> this.
>>>
>>> thanks
>>> Chaitanya
>>>
>>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/586023c6-8a37-4662-a592-0047b7c916d4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/grpc-io/586023c6-8a37-4662-a592-0047b7c916d4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/3533c9ab-ad6a-4566-9e49-ed438d565eb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to