Interface IAsyncEvent
Represents asynchronous event.
Namespace: DotNext.Threading
Assembly: DotNext.Threading.dll
Syntax
public interface IAsyncEvent : ISynchronizer, IDisposable
Properties
| Improve this Doc View SourceIsSet
Determines whether this event in signaled state.
Declaration
bool IsSet { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceReset()
Changes state of this even to non-signaled.
Declaration
bool Reset()
Returns
Type | Description |
---|---|
Boolean | 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. |
Signal()
Raises asynchronous event if it meets internal conditions.
Declaration
bool Signal()
Returns
Type | Description |
---|---|
Boolean | 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. |
WaitAsync(TimeSpan, CancellationToken)
Suspends the caller until this event is set.
Declaration
Task<bool> WaitAsync(TimeSpan timeout, CancellationToken token)
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 |
---|---|
Task<Boolean> | true, if this event was set; otherwise, false. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | The current instance has already been disposed. |
ArgumentOutOfRangeException |
|
OperationCanceledException | The operation has been canceled. |