Akka.Remote.EndpointRegistry.RefuseUid C# (CSharp) Метод

RefuseUid() публичный Метод

public RefuseUid ( Akka.Actor.Address address ) : int?
address Akka.Actor.Address
Результат int?
        public int? RefuseUid(Address address)
        {
            // timeOfRelease is only used for garbage collection. If an address is still probed, we should report the
            // known fact that it is quarantined.
            var policy = WritableEndpointWithPolicyFor(address);
            var q = policy as EndpointManager.Quarantined;
            var p = policy as EndpointManager.Pass;
            if (q != null) return q.Uid;
            if (p != null) return p.RefuseUid;
            return null;
        }

Usage Example

Пример #1
0
        private void KeepQuarantinedOr(Address remoteAddress, Action body)
        {
            var uid = _endpoints.RefuseUid(remoteAddress);

            if (uid.HasValue)
            {
                _log.Info(
                    "Quarantined address [{0}] is still unreachable or has not been restarted. Keeping it quarantined.",
                    remoteAddress);
                // Restoring Quarantine marker overwritten by a Pass(endpoint, refuseUid) pair while probing remote system.
                _endpoints.MarkAsQuarantined(remoteAddress, uid.Value, Deadline.Now + _settings.QuarantineDuration);
            }
            else
            {
                body();
            }
        }