Class SingleAssignmentSubscription
Subscription that supports exactly one assignment of an inner subscription.
Inheritance
Namespace: Reaqtive
Assembly: Reaqtive.Core.dll
Syntax
public sealed class SingleAssignmentSubscription : Object, IFutureSubscription, ISubscription, IDisposable
Constructors
SingleAssignmentSubscription()
Creates a new single assignment subscription with no initial inner subscription assigned.
Declaration
public SingleAssignmentSubscription()
Properties
IsDisposed
Gets a flag indicating whether the subscription has been disposed.
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Subscription
Gets or sets the inner subscription.
When the subscription is already disposed, a null
reference will be returned, and the assignment of an inner subscription will result in immediate disposal.
Any attempt to set an inner subscription when an inner subscription has already been set will result in an InvalidOperationException being thrown.
Declaration
public ISubscription Subscription { get; set; }
Property Value
Type | Description |
---|---|
ISubscription |
Methods
Accept(ISubscriptionVisitor)
Accepts a subscription visitor that will visit the inner subscription if it has been set already.
Declaration
public void Accept(ISubscriptionVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
ISubscriptionVisitor | visitor | Visitor to visit the subscription. |
Dispose()
Disposes the subscription. If an inner subscription has been set already, it will be disposed. Otherwise, the inner subscription will get disposed upon its assignment.
Declaration
public void Dispose()