public void Publish(AddressTerminated msg)
 {
     foreach (var subscriber in _subscribers.Value)
     {
         subscriber.Tell(msg, ActorRefs.NoSender);
     }
 }
        /// <summary>
        /// Sends alls registered subscribers an <see cref="AddressTerminated"/> notification.
        /// </summary>
        /// <param name="msg">The message that is sent to all subscribers.</param>
        public void Publish(AddressTerminated msg)
        {
            List <IActorRef> subscribers;

            lock (_subscribers)
                subscribers = _subscribers.ToList();

            foreach (var subscriber in subscribers)
            {
                subscriber.Tell(msg, ActorRefs.NoSender);
            }
        }