Convergence() public method

public Convergence ( UniqueAddress selfUniqueAddress ) : bool
selfUniqueAddress UniqueAddress
return bool
コード例 #1
0
ファイル: ClusterEvent.cs プロジェクト: tjaskula/akka.net
        /// <summary>
        /// TBD
        /// </summary>
        /// <param name="oldGossip">TBD</param>
        /// <param name="newGossip">TBD</param>
        /// <param name="selfUniqueAddress">TBD</param>
        /// <returns>TBD</returns>
        internal static ImmutableList<SeenChanged> DiffSeen(Gossip oldGossip, Gossip newGossip, UniqueAddress selfUniqueAddress)
        {
            if (newGossip.Equals(oldGossip))
            {
                return ImmutableList<SeenChanged>.Empty;
            }

            var newConvergence = newGossip.Convergence(selfUniqueAddress, EmptySet);
            var newSeenBy = newGossip.SeenBy;
            if (!newConvergence.Equals(oldGossip.Convergence(selfUniqueAddress, EmptySet)) || !newSeenBy.SequenceEqual(oldGossip.SeenBy))
            {
                return ImmutableList.Create(new SeenChanged(newConvergence, newSeenBy.Select(s => s.Address).ToImmutableHashSet()));
            }

            return ImmutableList<SeenChanged>.Empty;
        }
コード例 #2
0
        internal static ImmutableList <SeenChanged> DiffSeen(Gossip oldGossip, Gossip newGossip, UniqueAddress selfUniqueAddres)
        {
            if (newGossip.Equals(oldGossip))
            {
                return(ImmutableList.Create <SeenChanged>());
            }

            var newConvergence = newGossip.Convergence(selfUniqueAddres);
            var newSeenBy      = newGossip.SeenBy;

            if (newConvergence != oldGossip.Convergence(selfUniqueAddres) || newSeenBy != oldGossip.SeenBy)
            {
                return(ImmutableList.Create(new SeenChanged(newConvergence,
                                                            newSeenBy.Select(s => s.Address).ToImmutableHashSet())));
            }
            return(ImmutableList.Create <SeenChanged>());
        }
コード例 #3
0
        internal static ImmutableList<SeenChanged> DiffSeen(Gossip oldGossip, Gossip newGossip, UniqueAddress selfUniqueAddres)
        {
            if (newGossip.Equals(oldGossip)) 
                return ImmutableList.Create<SeenChanged>();

            var newConvergence = newGossip.Convergence(selfUniqueAddres);
            var newSeenBy = newGossip.SeenBy;
            if (newConvergence != oldGossip.Convergence(selfUniqueAddres) || newSeenBy != oldGossip.SeenBy)
                return ImmutableList.Create(new SeenChanged(newConvergence,
                        newSeenBy.Select(s => s.Address).ToImmutableHashSet()));
            return ImmutableList.Create<SeenChanged>();
        }