canmove, Confirmed users
725
edits
Line 234: | Line 234: | ||
You're probably sick of writing subclasses by this point, but don't worry: this one is very easy. I saved it for last because it requires the least code. | You're probably sick of writing subclasses by this point, but don't worry: this one is very easy. I saved it for last because it requires the least code. | ||
Your class must derive from the <tt>SyncEngine</tt> class, defined in <tt> | Your class must derive from the <tt>SyncEngine</tt> class, defined in <tt>services-sync/modules/engines.js</tt>. <tt>SyncEngine</tt> contains a lot of code which handles logic for the core sync algorithm, but your subclass won't need to call any of this directly, unless you are overriding part of the sync algorithm to provide custom sync behavior (an advanced technique outside the scope of this article). | ||
A sample Engine class: | A sample Engine class: | ||
Line 258: | Line 258: | ||
const Cu = Components.utils; | const Cu = Components.utils; | ||
// etc... | // etc... | ||
Cu.import("resource:// | Cu.import("resource://services-sync/engines.js"); | ||
== Installing your classes into Weave == | == Installing your classes into Weave == |