DBusSignalSubscription class

Namespace Runic.Platform.Linux.DBus in Runic.Platform.Linux.DBus 0.23.0

public sealed class DBusSignalSubscription : IAsyncEnumerable<DBusSignal>, IAsyncDisposable

Inherits or implements IAsyncEnumerable, IAsyncDisposable.

Signals that match one filter, in the order the connection received them.

Remarks

Enumerate it once. Enumeration ends when the subscription is disposed, and throws DBusException with DBusException.Disconnected when the connection closes. File descriptors in signals that are never read, because the subscription was disposed or its enumeration stopped first, are closed when the subscription is disposed; a descriptor in a signal that enumeration returned belongs to the reader.

Methods

DisposeAsync

public ValueTask DisposeAsync()

Stops receiving signals; an enumeration in progress ends after the signals already received.

Remarks

Signals that were received but not read are dropped, and their file descriptors closed, once no enumeration is in progress.

GetAsyncEnumerator

public IAsyncEnumerator<DBusSignal> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Exceptions

InvalidOperationException

The subscription is already being enumerated.

Inherits documentation from a base member that this reference does not include.