ObserverManager<TIdentity, TObserver>
class
Namespace: Orleans.Utilities
Maintains a collection of observers.
public class ObserverManager<TIdentity, TObserver> : IEnumerable<TObserver>, IEnumerable where TIdentity : notnullConstructors
ObserverManager<TIdentity, TObserver>(TimeSpan, ILogger)Initializes a new instance of theOrleans.Utilities.ObserverManagerclass.
Properties
CountGets the number of observers.ExpirationDurationGets or sets the expiration time span, after which observers are lazily removed.GetDateTimeGets or sets the delegate used to get the date and time, for expiry.ObserversGets a copy of the observers.
Methods
ClearRemoves all observers.ClearExpiredRemoved all expired observers.GetEnumeratorReturns an enumerator that iterates through the collection.Notify(Func<TObserver, Task>, Func<TObserver, bool>)Notifies all observers.Notify(Action<TObserver>, Func<TObserver, bool>)Notifies all observers which match the providedpredicate.Subscribe(TIdentity, TObserver)Ensures that the providedobserveris subscribed, renewing its subscription.Unsubscribe(TIdentity)Ensures that the providedidis unsubscribed.
