Constructor

Snapshot

new Snapshot()

Example

//-
// From {@link PubSub#getSnapshots}:
//-
pubsub.getSnapshots((err, snapshots) => {
  // `snapshots` is an array of Snapshot objects.
});

//-
// From {@link PubSub#getSnapshotsStream}:
//-
pubsub.getSnapshotsStream()
  .on('error', console.error)
  .on('data', (snapshot) => {
    // `snapshot` is a Snapshot object.
  });

//-
// From {@link PubSub#snapshot}:
//-
const snapshot = pubsub.snapshot('my-snapshot');
// snapshot is a Snapshot object.

//-
// Create a snapshot with {module:pubsub/subscription#createSnapshot}:
//-
const subscription = pubsub.subscription('my-subscription');

subscription.createSnapshot('my-snapshot', (err, snapshot) => {
  if (!err) {
    // `snapshot` is a Snapshot object.
  }
});

//-
// Seek to your snapshot:
//-
const subscription = pubsub.subscription('my-subscription');

subscription.seek('my-snapshot', (err) => {
  if (err) {
    // Error handling omitted.
  }
});