Implementation-defined shape of an application snapshot. Allows custom snapshot implementations for legacy applications to define their own snapshot format.
Method to determine if the SnapshotSource has been initialized.
Use when the parent application is starting up to ensure the SnapshotSource is able to accept and apply a snapshot using the applySnapshot method.
let snapshotSource = fin.SnapshotSource.wrapSync(fin.me);
const snapshotProvider = {
async getSnapshot() { return 'foo' },
async applySnapshot(snapshot) {
console.log(snapshot);
return undefined;
}
}
await fin.SnapshotSource.init(snapshotProvider);
try {
await snapshotSource.ready();
await snapshotSource.applySnapshot('foo');
} catch (err) {
console.log(err)
}
Enables configuring a SnapshotSource with custom getSnapshot and applySnapshot methods.