Exemple #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);
        }
        /// <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);
        }
        /// <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);
        }
Exemple #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);
        }
        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));
        }
        /// <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);
        }