public void AddNotification(DeadManSwitchNotification deadManSwitchNotification) { Interlocked.Exchange(ref _lastNotifiedTicks, DateTime.UtcNow.Ticks); lock (_notificationsSyncRoot) { _notifications[_notificationsNextItemIndex] = deadManSwitchNotification; _notificationsNextItemIndex = (_notificationsNextItemIndex + 1) % _notifications.Length; } }
public ValueTask AddNotificationAsync(DeadManSwitchNotification deadManSwitchNotification, CancellationToken cancellationToken) { return(_notificationsWriter.WriteAsync(deadManSwitchNotification, cancellationToken)); }