gRPC for chat application, is it possible? How to do message broking for users

960 views
Skip to first unread message

Constantine

unread,
Feb 28, 2017, 1:29:16 PM2/28/17
to grpc.io
Hi :)

I recently learnt about gRPC and I really like to do a toy example with it. As the old RPC chat programs, is it possible to write a chat application that uses gRPC ?

I tried to do it but there is a problem with it that I couldn't figure it out:
How to push data from the server to a client?(in the time that the server needs to send a new message from sender to receiver)

I really appreciate if you help me or give a lead to follow :)
thank you :)

Christian Rivasseau

unread,
Feb 28, 2017, 1:36:21 PM2/28/17
to Constantine, grpc.io

Hi,

I'd suggest that each client sends a request to a grpc endpoint that's annotated with stream response and then the server can hang on to the stream (for instance in a user id -> stream map) and push messages to it.

Take a look at the streaming examples for your language.

Christian


--
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 grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
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/f6ff290d-9aeb-4cae-818b-b0e14839a5f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Christian Rivasseau
Co-founder and CTO @ Lefty
+33 6 67 35 26 74

Reply all
Reply to author
Forward
0 new messages