hook up grpc call with event handlers

404 views
Skip to first unread message

Jeivardan

unread,
Nov 11, 2020, 4:46:11 AM11/11/20
to grpc.io
Hi all,

I am trying to connect two services with grpc where server is in C# and client can be in any language. Service in C# is a layered system with layered event based architecture where each layer subscribes to event given by the below layer. my problem is since it is event based architecture response are arrived to separate methods(event handlers)  and i need to send back the result to client when I receive the response in event handlers but the problem is client calls a method called startscan() where it subscribes to event and response is arrived in another method Onstartscan() and how to return it to client.

Thanks,
Jeivardan V

Jan Tattermusch

unread,
Nov 17, 2020, 7:44:27 AM11/17/20
to grpc.io
Hey,

your question isn't really gRPC specific, but I'll try to respond anyway.

Based on my very limited understanding of how your system works, I think you're basically looking for a pattern that allows you to switch from  async-await model of invoking request into an event-based reactive model. Support for "Channels" has been added to .NET Core and it might well be the pattern you're looking for:

Cheers

Jeivardan

unread,
Jan 7, 2021, 4:22:28 AM1/7/21
to Jan Tattermusch, grpc.io
Thank you Jan it was the same thing I was looking for


--
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 view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/81cffdc0-1184-4ed3-a3f4-0dccc976b9f9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages