Show / Hide Table of Contents

Class ObserverSubscriptionManager<T>

The ObserverSubscriptionManager class is a helper class for grains that support observers. It provides methods for tracking subscribing observers and for sending notifications.

Inheritance
System.Object
ObserverSubscriptionManager<T>
Namespace: Orleans
Assembly: Orleans.Core.Legacy.dll
Syntax
public class ObserverSubscriptionManager<T> : object where T : IGrainObserver
Type Parameters
Name Description
T

The observer interface type to be managed.

Constructors

| Improve this Doc View Source

ObserverSubscriptionManager()

Constructs an empty subscription manager.

Declaration
public ObserverSubscriptionManager()

Properties

| Improve this Doc View Source

Count

Number of subscribers currently registered

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Clear()

Removes all subscriptions.

Declaration
public void Clear()
| Improve this Doc View Source

IsSubscribed(T)

Determines if the SubscriptionManager has the input observer

Declaration
public bool IsSubscribed(T observer)
Parameters
Type Name Description
T observer

True if the the observer is already subscribed, otherwise False.

Returns
Type Description
System.Boolean

True is the SubscriptionManager has the input observer.

| Improve this Doc View Source

Notify(Action<T>)

Sends a notification to all subscribers.

Declaration
public void Notify(Action<T> notification)
Parameters
Type Name Description
Action<T> notification

An action that sends the notification by invoking the proper method on the provided subscriber. This action is called once for each current subscriber.

| Improve this Doc View Source

Subscribe(T)

Records a new subscribing observer.

Declaration
public void Subscribe(T observer)
Parameters
Type Name Description
T observer

The new subscriber.

| Improve this Doc View Source

Unsubscribe(T)

Removes a (former) subscriber.

Declaration
public void Unsubscribe(T observer)
Parameters
Type Name Description
T observer

The unsubscribing observer.

Extension Methods

ImmutableExt.AsImmutable<T>(T)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX