Show / Hide Table of Contents

Class AsyncAutoResetEvent

Represents asynchronous version of .

Inheritance
Object
Disposable
QueuedSynchronizer
AsyncAutoResetEvent
Implements
IAsyncResetEvent
IAsyncEvent
IDisposable
Inherited Members
QueuedSynchronizer.MeasurementTags
QueuedSynchronizer.TrackSuspendedCallers(Nullable<Func<Object>>)
QueuedSynchronizer.SetCallerInformation(Object)
QueuedSynchronizer.GetSuspendedCallers()
QueuedSynchronizer.LockContentionCounter
QueuedSynchronizer.LockDurationCounter
QueuedSynchronizer.CancelSuspendedCallers(CancellationToken)
QueuedSynchronizer.Dispose(Boolean)
QueuedSynchronizer.Dispose(Nullable<Exception>)
QueuedSynchronizer.DisposeAsyncCore()
QueuedSynchronizer.DisposeAsync()
Disposable.IsDisposed
Disposable.IsDisposing
Disposable.IsDisposingOrDisposed
Disposable.ThrowIfDisposed()
Disposable.DisposedTask
Disposable.GetDisposedTask<T>()
DotNext.Disposable.TrySetDisposedException<T>(TaskCompletionSource<>)
Disposable.TrySetDisposedException(TaskCompletionSource)
Disposable.TryBeginDispose()
Disposable.Dispose()
DotNext.Disposable.Dispose(IEnumerable<>)
DotNext.Disposable.DisposeAsync(IEnumerable<>)
Disposable.Dispose(Nullable<IDisposable>[])
Disposable.DisposeAsync(Nullable<IAsyncDisposable>[])
Namespace: DotNext.Threading
Assembly: DotNext.Threading.dll
Syntax
public class AsyncAutoResetEvent : QueuedSynchronizer, IAsyncResetEvent, IAsyncEvent

Constructors

| Improve this Doc View Source

AsyncAutoResetEvent(Boolean)

Initializes a new asynchronous reset event in the specified state.

Declaration
public AsyncAutoResetEvent(bool initialState)
Parameters
Type Name Description
Boolean initialState

true to set the initial state signaled; false to set the initial state to non signaled.

| Improve this Doc View Source

AsyncAutoResetEvent(Boolean, Int32)

Initializes a new asynchronous reset event in the specified state.

Declaration
public AsyncAutoResetEvent(bool initialState, int concurrencyLevel)
Parameters
Type Name Description
Boolean initialState

true to set the initial state signaled; false to set the initial state to non signaled.

Int32 concurrencyLevel

The expected number of concurrent flows.

Properties

| Improve this Doc View Source

IsSet

Indicates whether this event is set.

Declaration
public bool IsSet { get; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

Reset()

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

Declaration
public bool Reset()
Returns
Type Description
Boolean

true if the operation succeeds; otherwise, false.

| Improve this Doc View Source

Set()

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

Declaration
public bool Set()
Returns
Type Description
Boolean

true if the operation succeeds; otherwise, false.

| Improve this Doc View Source

WaitAsync(CancellationToken)

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

Declaration
public ValueTask WaitAsync(CancellationToken token = null)
Parameters
Type Name Description
CancellationToken token

The token that can be used to abort wait process.

Returns
Type Description
ValueTask

The task representing asynchronous result.

| Improve this Doc View Source

WaitAsync(TimeSpan, CancellationToken)

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

Declaration
public ValueTask<bool> WaitAsync(TimeSpan timeout, CancellationToken token = null)
Parameters
Type Name Description
TimeSpan timeout

The interval to wait for the signaled state.

CancellationToken token

The token that can be used to abort wait process.

Returns
Type Description
ValueTask<Boolean>

true if signaled state was set; otherwise, false.

Explicit Interface Implementations

| Improve this Doc View Source

IAsyncEvent.Signal()

Declaration
bool IAsyncEvent.Signal()
Returns
Type Description
Boolean
| Improve this Doc View Source

IAsyncResetEvent.ResetMode

Declaration
EventResetMode IAsyncResetEvent.ResetMode { get; }
Returns
Type Description
EventResetMode

Implements

IAsyncResetEvent
IAsyncEvent
IDisposable

Extension Methods

AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
ObjectExtensions.GetUserData<T>(T)
ObjectExtensions.IsOneOf<T>(T, IEnumerable<T>)
ObjectExtensions.IsOneOf<T>(T, T[])
ObjectExtensions.As<T>(T)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Supported by the .NET Foundation
☀
☾