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

Model sync #65

Open
hongnk opened this issue Sep 25, 2015 · 3 comments
Open

Model sync #65

hongnk opened this issue Sep 25, 2015 · 3 comments
Labels

Comments

@hongnk
Copy link

hongnk commented Sep 25, 2015

I'm still trying to understand how Swarm works for collaborated editing.

Supposed one site created a new object extending a predefined model, how that new object be replicated to another site? I did observe an object with same ID that is already defined on both sites would be piped through, but a new object with new ID didn't seem to do so.

Perhaps I don't understand the flow clearly for the above? A code example will be great.

@hongnk
Copy link
Author

hongnk commented Oct 30, 2015

Now I understand that the server side only forward models to listeners with known IDs. Perhaps new IDs need some sort of reference to be able to find listeners it must replicate to. I found Syncable.Ref in the code but not sure how it could be used. I hope there could be a way to define channel ID, where all objects belong to a channel would be replicated, regardless of object ID.

@gritzko
Copy link
Owner

gritzko commented Oct 31, 2015

Swarm is not channel-based. It is object-based.
The typical approach is to put your objects into a collection with a
predefined id, then open that collection.
That way, a collection works as a "channel".

On 30 October 2015 at 23:39, hongnk [email protected] wrote:

Now I understand that the server side only forward models to listeners
with known IDs. Perhaps new IDs need some sort of reference to be able to
find listeners it must replicate to. I found Syncable.Ref in the code but
not sure how it could be used. I hope there could be a way to define
channel ID, where all objects belong to a channel would be replicated,
regardless of object ID.


Reply to this email directly or view it on GitHub
#65 (comment).

Victor

@hongnk
Copy link
Author

hongnk commented Nov 6, 2015

Yes I thiink that works. The trick is to create a collection of Syncable.Ref, then all objects referenced in that collection will be replicated.

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