SnapshotsSubscriber¶
SnapshotsSubscriber
is used by ExecutorPodsSnapshotsStoreImpl to manage snapshot subscribers that are notified about new ExecutorPodsSnapshots regularly.
SnapshotsSubscriber
manages snapshotsBuffer queue of ExecutorPodsSnapshots.
SnapshotsSubscriber
is a private class
of ExecutorPodsSnapshotsStoreImpl with full access to its internals.
Creating Instance¶
SnapshotsSubscriber
takes the following to be created:
SnapshotsSubscriber
is created when:
ExecutorPodsSnapshotsStoreImpl
is requested to add a subscriber
onNewSnapshots Callback Function¶
onNewSnapshots: Seq[ExecutorPodsSnapshot] => Unit
SnapshotsSubscriber
is given a onNewSnapshots
callback function when created.
snapshotsBuffer Queue¶
snapshotsBuffer: LinkedBlockingQueue[ExecutorPodsSnapshot]
SnapshotsSubscriber
manages a snapshotsBuffer
queue of ExecutorPodsSnapshots.
notificationCount Counter¶
notificationCount: AtomicInteger
SnapshotsSubscriber
manages a notificationCount
counter.
addCurrentSnapshot¶
addCurrentSnapshot(): Unit
addCurrentSnapshot
requests the snapshotsBuffer internal queue to add the current ExecutorPodsSnapshot.
addCurrentSnapshot
is used when:
ExecutorPodsSnapshotsStoreImpl
is requested to add a subscriber and addCurrentSnapshotToSubscribers
processSnapshots¶
processSnapshots(): Unit
processSnapshots
increments the notificationCount counter followed by processSnapshotsInternal.
processSnapshots
is used when:
- ScheduledExecutorService (of
ExecutorPodsSnapshotsStoreImpl
) executes regularly (for a subscriber) ExecutorPodsSnapshotsStoreImpl
is requested to notify all subscribers
processSnapshotsInternal¶
processSnapshotsInternal(): Unit
processSnapshotsInternal
...FIXME
Note
processSnapshotsInternal
can be called again recursively when the notificationCount counter has been incremented while the processSnapshotsInternal
was running.