Method ListenOnceAsync
- Namespace
- SodaFlow
- Assembly
- SodaFlow.dll
ListenOnceAsync<T>(Stream<T>)
Handle the first event on this stream and then automatically unregister.
public static Task<T> ListenOnceAsync<T>(this Stream<T> s)
Parameters
sStream<T>The stream.
Returns
- Task<T>
A task that completes at the next firing of this stream.
Type Parameters
TThe type of the stream.
ListenOnceAsync<T>(Stream<T>, CancellationToken)
Handle the first event on this stream and then automatically unregister.
public static Task<T> ListenOnceAsync<T>(this Stream<T> s, CancellationToken token)
Parameters
sStream<T>The stream.
tokenCancellationTokenThe cancellation token.
Returns
- Task<T>
A task that completes at the next firing of this stream.
Type Parameters
TThe type of the stream.