Struct Notification<T>
Notification that indicates a value was received or that the observer completed.
public readonly struct Notification<T>
Type Parameters
TThe type of the value that was read from the message.
- Inherited Members
Remarks
The completion notifications are limited to those specified with the ObserverFlags.
Properties
Exception
Returns an exception that indicates why the observer completed.
public Exception Exception { get; }
Property Value
Exceptions
- InvalidOperationException
The notification is not a completion.
HasValue
Returns whether a value was successfully read from the message.
public bool HasValue { get; }
Property Value
IsCompletion
Returns whether this is a completion notification.
public bool IsCompletion { get; }
Property Value
State
Gets the optional state object.
public object? State { get; }
Property Value
Type
Gets the type of notification.
public NotificationType Type { get; }
Property Value
Value
Gets the value read from the message.
public T Value { get; }
Property Value
- T
Exceptions
- InvalidOperationException
The notification is not a value as indicated by HasValue.
Methods
Stop()
Stops the observer. No more notifications will be received.
public void Stop()
Remarks
No completion notification will be sent for the dispose.