Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

What's the idea with the Broadcast Hub in UserActor? #103

Open
mrwillis opened this issue Mar 21, 2018 · 1 comment
Open

What's the idea with the Broadcast Hub in UserActor? #103

mrwillis opened this issue Mar 21, 2018 · 1 comment

Comments

@mrwillis
Copy link

Hi,

I'm trying to wrap my head around with the design of this example. One thing that is confusing me is the hubSource in UserActor. Why is it required that there is a fan-out mechanism here? I understand that sending stuff to the hubSink will propogate to the client via the websocketFlow, but I'm not sure what the requirement for the multiple consumers of the flow. Isn't UserActor created for each WebSocket connection via the UserParentActor? If so, who are the extra subscribers if they are not the users?

Thank you

@wsargent
Copy link
Member

It's so you can add stocks after the flow has started:

https://github.com/playframework/play-scala-websocket-example/blob/2.6.x/app/actors/UserActor.scala#L94

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants