Confirmed users
90
edits
No edit summary |
|||
Line 30: | Line 30: | ||
[[File:Fxos sync v1.png]] | [[File:Fxos sync v1.png]] | ||
Periodic sync | === Periodic sync === | ||
1. The App is installed with permission to read/write data type T. It wants to sync the T DataStore with a remote service. So its ServiceWorker sends a ''requestSync'' message, specifying the duration of the interval between sync requests. | 1. The App is installed with permission to read/write data type T. It wants to sync the T DataStore with a remote service. So its ServiceWorker sends a ''requestSync'' message, specifying the duration of the interval between sync requests. | ||
Line 40: | Line 40: | ||
4. When it is a good time to sync, the Scheduler sends a ''sync'' message to the App's ServiceWorker. This awakens the worker, but does not display the app. The app can now pull and push. (The app is responsible for the sync logic.) | 4. When it is a good time to sync, the Scheduler sends a ''sync'' message to the App's ServiceWorker. This awakens the worker, but does not display the app. The app can now pull and push. (The app is responsible for the sync logic.) | ||
One-time sync | === One-time sync === | ||
1. Some other App modifies the data in DataStore T. The App's ServiceWorker receives a change notification (see 2 above). | 1. Some other App modifies the data in DataStore T. The App's ServiceWorker receives a change notification (see 2 above). |