Show / Hide Table of Contents

Interface IAsyncEvent

Represents asynchronous event.

Inherited Members
IDisposable.Dispose()
Namespace: DotNext.Threading
Assembly: DotNext.Threading.dll
Syntax
public interface IAsyncEvent : IDisposable, IResettable

Properties

| Edit this page View Source

IsSet

Determines whether this event in signaled state.

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

Methods

| Edit this page View Source

Reset()

Changes state of this even to non-signaled.

Declaration
bool Reset()
Returns
Type Description
bool

true, if state of this object changed from signaled to non-signaled state; otherwise, false.

Exceptions
Type Condition
ObjectDisposedException

The current instance has already been disposed.

| Edit this page View Source

Signal()

Raises asynchronous event if it meets internal conditions.

Declaration
bool Signal()
Returns
Type Description
bool

true, if state of this object changed from non-signaled to signaled state; otherwise, false.

Exceptions
Type Condition
ObjectDisposedException

The current instance has already been disposed.

| Edit this page View Source

Wait(TimeSpan)

Blocks the current thread until this event is set.

Declaration
bool Wait(TimeSpan timeout)
Parameters
Type Name Description
TimeSpan timeout

The time to wait for the event.

Returns
Type Description
bool

true, if this event was set; otherwise, false.

Exceptions
Type Condition
ObjectDisposedException

The current instance has already been disposed.

ArgumentOutOfRangeException

timeout is negative.

| Edit this page View Source

WaitAsync(CancellationToken)

Suspends the caller until this event is set.

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

The token that can be used to cancel waiting operation.

Returns
Type Description
ValueTask

The task representing asynchronous result.

Exceptions
Type Condition
ObjectDisposedException

The current instance has already been disposed.

OperationCanceledException

The operation has been canceled.

| Edit this page View Source

WaitAsync(TimeSpan, CancellationToken)

Suspends the caller until this event is set.

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

The number of time to wait before this event is set.

CancellationToken token

The token that can be used to cancel waiting operation.

Returns
Type Description
ValueTask<bool>

true, if this event was set; otherwise, false.

Exceptions
Type Condition
ObjectDisposedException

The current instance has already been disposed.

ArgumentOutOfRangeException

timeout is negative.

OperationCanceledException

The operation has been canceled.

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾