예제 #1
0
        public Task CollectAsync(IUserNotification notification, string channel, ProcessStatus status)
        {
            Guard.NotNull(notification, nameof(notification));
            Guard.NotNullOrEmpty(channel, nameof(channel));

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(StoreCountersAsync(counterKey, counterMap));
        }
예제 #2
0
        public Task CollectAsync(IUserNotification notification, string channel, ProcessStatus status,
                                 CancellationToken ct = default)
        {
            Guard.NotNull(notification);
            Guard.NotNullOrEmpty(channel);

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(StoreCountersAsync(counterKey, counterMap, ct));
        }
예제 #3
0
        public Task InsertAsync(UserNotification notification, CancellationToken ct)
        {
            Guard.NotNull(notification, nameof(notification));

            var counterMap = CounterMap.ForNotification(ProcessStatus.Handled, 1);
            var counterKey = CounterKey.ForNotification(notification);

            return(Task.WhenAll(
                       StoreCountersAsync(counterKey, counterMap),
                       StoreInternalAsync(notification, ct)));
        }
예제 #4
0
        public Task CollectAndUpdateAsync(IUserNotification notification, string channel, ProcessStatus status, string?detail)
        {
            Guard.NotNull(notification, nameof(notification));
            Guard.NotNullOrEmpty(channel, nameof(channel));

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(Task.WhenAll(
                       StoreCountersAsync(counterKey, counterMap),
                       StoreInternalAsync(notification.Id, channel, status, detail)));
        }
예제 #5
0
        public Task CollectAndUpdateAsync(IUserNotification notification, string channel, string configuration, ProcessStatus status, string?detail = null,
                                          CancellationToken ct = default)
        {
            Guard.NotNull(notification);
            Guard.NotNullOrEmpty(channel);

            var counterMap = CounterMap.ForChannel(channel, status);
            var counterKey = CounterKey.ForNotification(notification);

            return(Task.WhenAll(
                       StoreCountersAsync(counterKey, counterMap, ct),
                       StoreInternalAsync(notification.Id, channel, configuration, status, detail)));
        }