Implementation of Push Notifications in C#

573 views
Skip to first unread message

jonath...@ubisoft.com

unread,
Sep 17, 2018, 2:03:28 PM9/17/18
to grpc.io

Hello everyone,

 

I was following the presentation on “gRPC: Efficient RPC framework for .NET microservices” at .NET Fringe 2017 and I have a question regarding gRPC and streaming. In essence, we have .NET Core client and services and we need to implement a push notification feature. I based myself on the examples on GitHub (Helloworld and RouteGuide) and a few examples on the web (java and nodejs) to come up with a primitive implementation (https://github.com/jonathandotchin/grpc/commit/9551e5528767ae62b8d5456393361bf4ee7a5410). I was wondering if any of you have some input on whether or not I am on the right track.

 

In essence,

GreeterClient subscribe to GreeterServer to receive notification via stream

GreeterPanel issues messages to GreeterServer who in turns sends notification

GreeterServer handles the subscription and forward messages (aka the notifications)

 

One thing I am not sure of is how GreeterServer handles the subscription. In order to keep the stream alive, I am looping (examples/csharp/Helloworld/GreeterServer/Program.cs@52). Obviously, I would need to break the loop but I was wondering if this is the correct way of implementing a push notification in gRPC in .NET? If not, is there an example that I can look at?

 

Thanks,

 

Jonathan

 

Reply all
Reply to author
Forward
0 new messages