DotNext.Threading by .NET Foundation and Contributors

<PackageReference Include="DotNext.Threading" Version="4.4.0" />

 AsyncAutoResetEvent

Represents asynchronous version of AutoResetEvent.
public bool IsSet { get; }

Indicates whether this event is set.

public AsyncAutoResetEvent(bool initialState, int concurrencyLevel)

Initializes a new asynchronous reset event in the specified state.

public AsyncAutoResetEvent(bool initialState)

Initializes a new asynchronous reset event in the specified state.

public bool Reset()

Sets the state of this event to non signaled, causing consumers to wait asynchronously.

public bool Set()

Sets the state of the event to signaled, allowing one or more awaiters to proceed.

public ValueTask<bool> WaitAsync(TimeSpan timeout, CancellationToken token = default)

Turns caller into idle state until the current event is set.

public ValueTask WaitAsync(CancellationToken token = default)

Turns caller into idle state until the current event is set.