BB.Caching.Redis.Analytics.Ops.OrAsync C# (CSharp) Method

OrAsync() public static method

Combines events by finding their logical union.
public static OrAsync ( ) : Task
return Task
        public static async Task<RedisKey> OrAsync(params Event[] events)
        {
            var database = SharedCache.Instance.GetAnalyticsWriteConnection().GetDatabase(SharedCache.Instance.Db);

            // get the keys for the events (no need to group subsets since the full thing will be OR'd)
            var taskKeys = events.Select(@event => @event.RedisKeysAsync());

            var tempKeys = await Task.WhenAll(taskKeys);

            var keys = tempKeys.SelectMany(x => x).ToArray();

            RedisKey tmpKey = TempKey(events);
            await BitwiseAnalytics.BitwiseOrAsync(database, tmpKey, keys, TimeSpan.FromHours(1));
            return tmpKey;
        }