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

questions #11

Open
siddo420 opened this issue Oct 13, 2015 · 2 comments
Open

questions #11

siddo420 opened this issue Oct 13, 2015 · 2 comments

Comments

@siddo420
Copy link

Hi,

  1. Are spark IDs always unique?

  2. What would be the most efficient way to associate additional information with each spark ID? So, even if sparks are disconnected and reconnected, we could transfer the associated info to new spark IDs.

  3. Can we easily make it check current server for spark IDs etc (ref: .sparks())?

  4. Does forward.sparks() also include current/local server for sending messages?

Thanks.

@3rd-Eden
Copy link
Member

  1. Spark id's are connection id's while they are unique they only live as long as the actual connection is alive. So when you get a reconnect the spark.id will be gone. If you want to have more persistent id's you can look at our mirage project.
  2. Probably just store data in an auto expiring database/cache like redis based on the connection or mirage id.
  3. In primus you can just use the primus.forEach method to iterate over all sparks that are connected that your primus server, this does not include the one's that are in a metroplex cluster.
  4. Yes, it checks and sends to local server before broadcasting it to the other connected servers.

@siddo420
Copy link
Author

Does metroplex emit event(s) when spark and/or server is disconnected/removed from registry?

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