Table of Contents

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

s Stream<T>

The stream.

Returns

Task<T>

A task that completes at the next firing of this stream.

Type Parameters

T

The 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

s Stream<T>

The stream.

token CancellationToken

The cancellation token.

Returns

Task<T>

A task that completes at the next firing of this stream.

Type Parameters

T

The type of the stream.