This repository has been archived by the owner on Oct 8, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 18
Synchronization Protocol
Lucas Satabin edited this page Dec 3, 2013
·
11 revisions
This protocol is derived from the original mobwrite protocol by Neil Fraser.
The protocol uses json messages to communicate between peers. This section describes these messages.
A synchronization session is a message that allows people to work on files for a given paper identifier. It is composed of the name of the peer sending the message, the paper identifier on which we are working and a list of synchronization commands to apply to files in this paper
For example:
{
"peerId": "toto",
"paperId": "v987fed987da70987f",
"commands": [
[ "file1.tex", 432767, <command> ],
[ "file2.tex", 87432, <command> ]
]
}
The synchronization commands work on a specific file of the paper at a specific revision. Thus they all are associated to a filename
and a revision
.
The commands are described below.
The following commands are available:
- send delta to the peer
{
"name": "delta",
"revision": 4324523,
"data": [ "=100", "-2", "+test", "=34" ],
"overwrite": false
}
- send raw text to the peer
{
"name": "raw",
"revision": 4324523,
"data": "Complete raw text",
"overwrite": false
}
- send paper deletion request to the peer
{
"name": "nullify"
}
- send some use message to broadcast to all connected peers
{
"name": "message",
"json": <json value>
}