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

Syncing client with server #176

Open
echo66 opened this issue Feb 16, 2016 · 5 comments
Open

Syncing client with server #176

echo66 opened this issue Feb 16, 2016 · 5 comments
Labels

Comments

@echo66
Copy link

echo66 commented Feb 16, 2016

Greetings!

Are there any working examples showing how to sync data between server and clients?

Thanks in advance!

@gr0uch
Copy link
Member

gr0uch commented Feb 16, 2016

Not yet, I will come up with some examples showcasing a few use cases soon enough. For now there's the tests:
https://github.com/fortunejs/fortune/blob/master/test/integration/net/ws_client.js

@echo66
Copy link
Author

echo66 commented Feb 16, 2016

I'm reading both client and server code. Where do I state the time interval between syncs?

@gr0uch
Copy link
Member

gr0uch commented Feb 16, 2016

There's no time interval, it's not polling. It uses WebSocket, so the server actually sends updates to the client at any time during the connection.

@echo66
Copy link
Author

echo66 commented Feb 19, 2016

Oh, ok! 👍

So, that raises the question: every CRUD action by a client will be send to all other clients?

@gr0uch
Copy link
Member

gr0uch commented Feb 19, 2016

By default, yes. However, the server can modify or omit the change before sending anything to clients via the change function.

If you have a cluster of servers, it gets a little tricky because then each server has to coordinate changes among each other to reach the right clients. It is possible to do but isn't abstracted by Fortune.js, at least not yet (I think it should take advantage of multiple cores by default).

@gr0uch gr0uch added the question label May 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants