}
shardCounter: shardCounter,
totalNumShards: totalNumShards,
updateAppliedCallback: updateAppliedCallback,
subscription: shardCounter.SubscribeShardCount(),
}
scaler.shardCount.Store(shardCountNotSet)
scaler.shutdownWG.Go(func() {
for count := range scaler.subscription.ShardCount() {
scaler.shardCount.Store(int64(count))
if scaler.updateAppliedCallback != nil {
scaler.updateAppliedCallback <- struct{}{}
}