anchor.diff:  
       let cts = new CancellationTokenSource()
   
  -    let stateTableReadyEvent = new Event<string>()
  +    let stateTableReadyEvent     = new Event<string>()  // when the state able is confirmed to be ready
  +    let workerCountChangedEvent  = new Event<int>()     // when the number of workers have changed
   
       let kinesis    = AWSClientFactory.CreateAmazonKinesisClient(awsKey, awsSecret, region)
       let dynamoDB   = AWSClientFactory.CreateAmazonDynamoDBClient(awsKey, awsSecret, region)    
  
positive.code:                            workers.Add(shardId, worker)
                             worker.OnStopped.Add(fun _ -> inbox.Post(RemoveWorker(shardId)))
                             reply.Reply()
                  | StopWorker(shardId, reply) -> 
                      match workers.TryGetValue(shardId) with
                      | true, worker -> 
                          async {
                              worker.Stop()
                              reply.Reply()
                          }
                          |> Async.Start
                          
                      | _ -> reply.Reply()
                  | RemoveWorker(shardId) -> workers.Remove(shardId) |> ignore
                  | AddKnownShard(shardId, reply) ->
                      if not <| knownShards.ContainsKey(shardId) then knownShards.Add(shardId, false)
                      reply.Reply()
  
negative.code: 
              refreshSub.Dispose()
  
              if workers.Count > 0 then
                  logDebug "Stopping all [{0}] workers..." [| workers.Count |]
  
                  workers.Keys 
                  |> Seq.toArray 
                  |> Seq.map (fun shardId -> stopWorker shardId)
                  |> Async.Parallel
                  |> Async.Ignore
                  |> Async.Start
                  
                  workerCountChangedEvent.Publish.Where(fun n -> n = 0).Take(1).Wait() |> ignore
  
                  logDebug "Workers stopped..." [||]
  
              cts.Cancel()
              cts.Dispose()
  