Comments (5)
@eduardofcbg, I could imagine that the multiple rooms is a next step for this activator. There are many aspects how to do it. To simplify, we can assume that we can create some static rooms so as to choose one of them on the first screen. After selecting a room, you should subscribe to an appropriate room's topic. A ChatRoom actor is only to manage a cluster communication.
We invite you to create PR in order to cooperate with code.
from clustered-chat.
@sergiuszkierat Thanks for the quick reply and I will take your invitation.
It seems easy enough to implement what you suggest. The UserSocket will take a specific room's id, which the actor will subscribe to.
A problem arises if I want to save state in a specific room. For that wouldn't I need a different actor for each one? In that case I'm having trouble getting my head around where to instantiate that actor. I guess I could create several in the controller, but what if I want to create them on demand when some user connects to a certain url?
Thanks a lot for you time.
from clustered-chat.
@eduardofcbg Not really, there should be only one UserSocket which is used to communicate between a user's browser and a web server. Instead of this, you should extend a ChatMessage. There should be changed a chat.coffee as well.
To have a state of your chat, you should use a persistance layer, so far a chat is volatile in his behaviour. If you switch between rooms, you should retrieve a data from server.
from clustered-chat.
I was thinking of using akka's event sourcing. Your suggestion simplifies a lot the problem, but in that case the actors will not have any actual state. I will rethink the solution.
Thanks a lot.
from clustered-chat.
Resolved by #5
from clustered-chat.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clustered-chat.