Interface SnapshotSubscriber

All Known Implementing Classes:
CosmosSessionStore, DynamoDbSessionStore, FileSessionStore, FirestoreSessionStore, InMemorySessionStore, MongoSessionStore, PostgresSessionStore

public interface SnapshotSubscriber
Optional capability: subscribe to a snapshot's status changes.

Stores that support real-time notifications (e.g. Firestore) implement this interface. Required for detach/abort workflows that need to observe when a running snapshot transitions to a terminal state.

  • Method Details

    • onSnapshotStateChange

      AutoCloseable onSnapshotStateChange(String snapshotId, Consumer<SessionSnapshot<?>> cb, SessionStoreOptions options)
      Subscribes to status changes for the snapshot identified by snapshotId.

      Invokes cb immediately with the current snapshot and again on every subsequent change. The returned AutoCloseable unsubscribes when closed.

      Parameters:
      snapshotId - the snapshot to observe
      cb - callback invoked with the updated snapshot on each change
      options - store options
      Returns:
      a handle that cancels the subscription when AutoCloseable.close() is called