Return value for client methods #1149

Closed
flipchart opened this Issue Dec 16, 2012 · 8 comments

Projects

None yet

9 participants

@flipchart

Hub methods on the server are able to have return values for the client to consume, but not the other way around. This means that the server cannot call a client and get a value from the method invocation. It would be great if this could be added as it would make server and client more symmetrical in their abilities.

@davidfowl
SignalR member

Maybe sometime in the far future. Moving to backlog.

@blakeja

I would still like to see this feature implemented at some point.

@mcintyre321

Me too.

@ManniAT

While I understand this would be hard for "broadcasts" it would be great to have this for "single receiver calls".

@DamianEdwards
SignalR member

Technically possible, but very easily mimicked in app code without SignalR having to do some heavy lifting under the covers.

We'll move this to the new repo as a candidate for v3 or beyond.

@DamianEdwards DamianEdwards added the v3 label Jun 24, 2014
@Palpie

How would I mimic this in my app code?

@timtos

Good question. How would I mimic this in my app code? Any hints?

@ericgrover

All you would need to do is have a call back method defined in your hub, so that the client instead of returning a value per se, would be calling a new method on the hub and passing the "return" value as the method parameter. You could then bundle this all together with the TPL so that both the initial call and the call back could be awaited using the EAP pattern as illustrated here: https://msdn.microsoft.com/en-us/library/ee622454(v=vs.110).aspx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment