private void WatchActor(IActorRef actor, int channel)
{
// every watched actor counter has 2 values identified by channel
// - channel 0: source actor watching counter
// - channel 1: monitor actor watching counter (to track monitoring actor destroyed)
int[] counts;
if (_actorWatchCountMap.TryGetValue(actor, out counts))
{
counts[channel] += 1;
return;
}
counts = new int[2];
counts[channel] += 1;
_actorWatchCountMap.Add(actor, counts);
Context.Watch(actor);
}