Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override dispatch to client from local application layer. #257

Closed
Elijah23Johnson opened this issue Jul 12, 2020 · 7 comments
Closed

Override dispatch to client from local application layer. #257

Elijah23Johnson opened this issue Jul 12, 2020 · 7 comments

Comments

@Elijah23Johnson
Copy link

Elijah23Johnson commented Jul 12, 2020

Provide an over ride via DI that can dispatch a message to any connected user given a variable key. Say customerId.

Example:

image

@dsuryd
Copy link
Owner

dsuryd commented Jul 12, 2020

This is covered by MulticastVM Send method. If that’s not sufficient, let’s discuss the use case.

@Elijah23Johnson
Copy link
Author

Elijah23Johnson commented Jul 12, 2020

True... I see that you have built in the capabilities to send to all subscribed clients who are associated with the MulticastVM instance.

But lets say for instance this library was just a small addition to a highly event driven program.
1.) How do I dispatch events to a given client from an event not associated with dotnetify?
2.) Enterprise Events

Suggestions
1.) We could subscribe to the same VM by referencing the groupname of a MulticastedVM.
2.) Provide another VM class that tracks connection id's and can properly dispatch to that one id would need memory cache for this.

@Elijah23Johnson
Copy link
Author

Please note that I have been able to override the dotnetify signalr hub and dispatch to all clients.

@dsuryd
Copy link
Owner

dsuryd commented Jul 15, 2020

In such use case, I can see a small component being embedded in the client page that connects to a multicast VM. A plain service with a dispatch method gets injected into the VM and is constructor-initialized so the dispatch method will invoke the VM's Send method. This service can then be injected in other non-VM classes to dispatch events through the multicast VM.

I think this is close to your suggestion 1? This service is plain enough, I don't see it needs to be part of the core library.

@Elijah23Johnson
Copy link
Author

Elijah23Johnson commented Jul 18, 2020

True but now when you take it to a multi server architecture or put it behind AWS LB then this solution does not work,

What about an extension in the core library to manage connection and servers that the connection originated from?

With this we can dispatch an action to the connected server and then forward the message to the given client.

Here's a good article about it
https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-in-signalr

@Elijah23Johnson
Copy link
Author

Elijah23Johnson commented Jul 18, 2020

For reference this is a continuation of this conversation ↓
#181
#163
A redis, elastic cluster would work great.

@dsuryd
Copy link
Owner

dsuryd commented Jul 22, 2020

Thank you for all your input. I agree there may be a need of an extension to the core library to support multi-server scale-out (as alternative to Azure). But this will be a much more complex and resource-consuming endeavor than I'm willing to take on for a FOSS with no strong sponsorship. I do have a plan to eventually offer this but it will be in a way that can support the long-term viability of the core project (#96). So I'm closing this as out-of-scope.

@dsuryd dsuryd closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants