BB.Caching.Redis.Analytics.Event.RedisKeys C# (CSharp) Method

RedisKeys() public method

All of the keys that would be involved in the period of time specified for this event.
public RedisKeys ( ) : RedisKey[]
return RedisKey[]
        public RedisKey[] RedisKeys()
        {
            // ReSharper disable once ConvertIfStatementToNullCoalescingExpression
            if (this._redisKeys == null)
            {
                this._redisKeys = BitwiseAnalytics.GetMinKeysForRange(
                    SharedCache.Instance.GetAnalyticsWriteConnection().GetDatabase(SharedCache.Instance.Db),
                    this._category,
                    this._action,
                    this._from,
                    this._to,
                    this._timeInterval);
            }

            return this._redisKeys;
        }

Usage Example

Beispiel #1
0
        /// <summary>
        /// Gets the logical negation of an event.
        /// </summary>
        /// <param name="event">
        /// The event to negate.
        /// </param>
        /// <returns>
        /// A <see cref="RedisKey"/> where the results have been stored.
        /// </returns>
        public static async Task<RedisKey> NotAsync(Event @event)
        {
            var database = SharedCache.Instance.GetAnalyticsWriteConnection().GetDatabase(SharedCache.Instance.Db);

            // get the keys for the event (need to group subsets using TemporarilyOrKeys)
            var key = await TemporarilyOrKeysAsync(database, @event.RedisKeys());

            RedisKey tmpKey = TempKey(@event);
            await BitwiseAnalytics.BitwiseNotAsync(database, tmpKey, key, TimeSpan.FromHours(1));
            return tmpKey;
        }