ObserverManager<TIdentity,TObserver> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Maintains a collection of observers.
public class ObserverManager<TIdentity,TObserver> : System.Collections.Generic.IEnumerable<TObserver>
type ObserverManager<'Identity, 'Observer> = class
interface seq<'Observer>
interface IEnumerable
Public Class ObserverManager(Of TIdentity, TObserver)
Implements IEnumerable(Of TObserver)
Type Parameters
- TIdentity
The address type, used to identify observers.
- TObserver
The observer type.
- Inheritance
-
ObserverManager<TIdentity,TObserver>
- Derived
- Implements
-
IEnumerable<TObserver> IEnumerable
Constructors
ObserverManager<TIdentity,TObserver>(TimeSpan, ILogger) |
Initializes a new instance of the ObserverManager<TIdentity,TObserver> class. |
Properties
Count |
Gets the number of observers. |
ExpirationDuration |
Gets or sets the expiration time span, after which observers are lazily removed. |
GetDateTime |
Gets or sets the delegate used to get the date and time, for expiry. |
Observers |
Gets a copy of the observers. |
Methods
Clear() |
Removes all observers. |
ClearExpired() |
Removed all expired observers. |
GetEnumerator() |
Returns an enumerator that iterates through the collection. |
Notify(Action<TObserver>, Func<TObserver,Boolean>) |
Notifies all observers which match the provided |
Notify(Func<TObserver,Task>, Func<TObserver,Boolean>) |
Notifies all observers. |
Subscribe(TIdentity, TObserver) |
Ensures that the provided |
Unsubscribe(TIdentity) |
Ensures that the provided |
Explicit Interface Implementations
IEnumerable.GetEnumerator() |
Returns an enumerator that iterates through a collection. |
Extension Methods
BatchIEnumerable<T>(IEnumerable<T>, Int32) |