コード例 #1
0
        /// <summary>
        /// Clears the StackExchange.Redis tiebreaker key from this node.
        /// </summary>
        public bool ClearSERedisTiebreaker()
        {
            RedisKey tieBreakerKey = SERedisTiebreakerKey;
            var      result        = this._connection.GetDatabase()
                                     .KeyDelete(tieBreakerKey, flags: CommandFlags.NoRedirect | CommandFlags.HighPriority);

            Tiebreaker.Poll(true);
            return(result);
        }
コード例 #2
0
        /// <summary>
        /// Clears the StackExchange.Redis tiebreaker key from this node.
        /// </summary>
        public async Task <bool> ClearSERedisTiebreakerAsync()
        {
            RedisKey tieBreakerKey = SERedisTiebreakerKey;
            var      result        = await _connection.GetDatabase()
                                     .KeyDeleteAsync(tieBreakerKey, flags: CommandFlags.NoRedirect | CommandFlags.HighPriority);

            Tiebreaker.Poll(true);
            return(result);
        }
コード例 #3
0
        /// <summary>
        /// Clears the StackExchange.Redis tiebreaker key from this node.
        /// </summary>
        public async Task <bool> ClearSERedisTiebreakerAsync()
        {
            RedisKey tieBreakerKey = SERedisTiebreakerKey;
            var      result        = await _connection.GetDatabase()
                                     .KeyDeleteAsync(tieBreakerKey, flags: CommandFlags.NoRedirect)
                                     .ConfigureAwait(false);

            await Tiebreaker.PollAsync(true).ConfigureAwait(false);

            return(result);
        }
コード例 #4
0
        /// <summary>
        /// Sets the StackExchange.Redis tiebreaker key on this node.
        /// </summary>
        public bool SetSERedisTiebreaker()
        {
            RedisKey tieBreakerKey = SERedisTiebreakerKey;

            var        myEndPoint      = this._connection.GetEndPoints().FirstOrDefault();
            RedisValue tieBreakerValue = EndPointCollection.ToString(myEndPoint);

            var result = this._connection.GetDatabase()
                         .StringSet(tieBreakerKey, tieBreakerValue, flags: CommandFlags.NoRedirect | CommandFlags.HighPriority);

            Tiebreaker.Poll(true);
            return(result);
        }
コード例 #5
0
        public int CompareTo(InitiativeCount other)
        {
            if (Base != other.Base)
            {
                return(Base.CompareTo(other.Base));
            }

            if (Dex != other.Dex)
            {
                return(Dex.CompareTo(other.Dex));
            }

            return(Tiebreaker.CompareTo(other.Tiebreaker));
        }
コード例 #6
0
        /// <summary>
        /// Sets the StackExchange.Redis tiebreaker key on this node.
        /// </summary>
        public async Task <bool> SetSERedisTiebreakerAsync()
        {
            RedisKey tieBreakerKey = SERedisTiebreakerKey;

            var        myEndPoint      = _connection.GetEndPoints().FirstOrDefault();
            RedisValue tieBreakerValue = EndPointCollection.ToString(myEndPoint);

            var result = await _connection.GetDatabase()
                         .StringSetAsync(tieBreakerKey, tieBreakerValue, flags: CommandFlags.NoRedirect);

            await Tiebreaker.PollAsync(true);

            return(result);
        }