INTERNAL API Mailbox for dead letters.
Inheritance: Akka.Dispatch.Mailbox
示例#1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Mailboxes" /> class.
 /// </summary>
 /// <param name="system">The system.</param>
 public Mailboxes(ActorSystem system)
 {
     _system = system;
     _deadLetterMailbox = new DeadLetterMailbox(system.DeadLetters);
     var mailboxConfig = system.Settings.Config.GetConfig("akka.actor.mailbox");
     var requirements = mailboxConfig.GetConfig("requirements").AsEnumerable().ToList();
     _requirementsMapping = new Dictionary<Type, Config>();
     foreach (var kvp in requirements)
     {
         var type = Type.GetType(kvp.Key);
         if (type == null)
         {
             //TODO: can't log here, logger not created yet
           //  system.Log.Warn("Mailbox Requirement mapping '{0}' is not an actual type",kvp.Key);
             continue;
         }
         var config = system.Settings.Config.GetConfig(kvp.Value.GetString());
         _requirementsMapping.Add(type, config);
     }
 }
示例#2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Mailboxes" /> class.
        /// </summary>
        /// <param name="system">The system.</param>
        public Mailboxes(ActorSystem system)
        {
            _system = system;
            _deadLetterMailbox = new DeadLetterMailbox(system.DeadLetters);
            var mailboxConfig = system.Settings.Config.GetConfig("akka.actor.mailbox");
            var requirements = mailboxConfig.GetConfig("requirements").AsEnumerable().ToList();
            _mailboxBindings = new Dictionary<Type, string>();
            foreach (var kvp in requirements)
            {
                var type = Type.GetType(kvp.Key);
                if (type == null)
                {
                    Warn($"Mailbox Requirement mapping [{kvp.Key}] is not an actual type");
                    continue;
                }
                _mailboxBindings.Add(type, kvp.Value.GetString());
            }

            _defaultMailboxConfig = Settings.Config.GetConfig(DefaultMailboxId);
        }
 public void SwapMailbox(DeadLetterMailbox mailbox)
 {
     Mailbox.DebugPrint("{0} Swapping mailbox to DeadLetterMailbox", Self);
     Interlocked.Exchange(ref _mailbox, mailbox);
 }
 public void SwapMailbox(DeadLetterMailbox mailbox)
 {
     Interlocked.Exchange(ref _mailbox, mailbox);
 }
 public void SwapMailbox(DeadLetterMailbox mailbox)
 {
     Mailbox.DebugPrint("{0} Swapping mailbox to DeadLetterMailbox", Self);
     Interlocked.Exchange(ref _mailbox, mailbox);
 }
 public void SwapMailbox(DeadLetterMailbox mailbox)
 {
     Interlocked.Exchange(ref _mailbox, mailbox);
 }
示例#7
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Mailboxes" /> class.
 /// </summary>
 /// <param name="system">The system.</param>
 public Mailboxes(ActorSystem system)
 {
     this.system = system;
     _deadLetterMailbox = new DeadLetterMailbox(system.DeadLetters);
 }