/// <summary> /// Notify one subscription /// </summary> public void Notify <T>(CollectionRawSubscription <T> collectionRawSubscription) where T : class { if (collectionRawSubscription.LiteCollection is null) { throw new InvalidOperationException("notification service is not initialized"); } var nextValue = collectionRawSubscription.LiteCollection; Task.Run(() => collectionRawSubscription.Observer?.OnNext(nextValue)); }
internal void NotifyIfNeeded <T>(CollectionRawSubscription <T> collectionRawSubscription, NotificationCache cache) where T : class { if (cache.Broadcasts.Contains(collectionRawSubscription.Collection)) { Notify(collectionRawSubscription); return; } if (cache.Collections.Contains(collectionRawSubscription.Collection)) { Notify(collectionRawSubscription); return; } }