Represents asynchronous version of ManualResetEvent.
InheritanceAsyncManualResetEvent
Namespace: DotNext.Threading Assembly: DotNext.Threading.dll Syntaxpublic class AsyncManualResetEvent : QueuedSynchronizer, IAsyncResetEvent, IAsyncEvent, IDisposable, IResettable
Constructors | Edit this page View Source AsyncManualResetEvent(bool)
Initializes a new asynchronous reset event in the specified state.
Declarationpublic AsyncManualResetEvent(bool initialState)
Parameters Type Name Description bool initialState
true to set the initial state signaled; false to set the initial state to non signaled.
| Edit this page View Source AsyncManualResetEvent(bool, int)Initializes a new asynchronous reset event in the specified state.
Declarationpublic AsyncManualResetEvent(bool initialState, int concurrencyLevel)
Parameters Type Name Description bool initialState
true to set the initial state signaled; false to set the initial state to non signaled.
int concurrencyLevelThe potential number of suspended callers.
Exceptions Properties | Edit this page View Source IsSetIndicates whether this event is set.
Declarationpublic bool IsSet { get; }
Property Value Methods | Edit this page View Source Reset()
Sets the state of this event to non signaled, causing consumers to wait asynchronously.
Declaration Returns Type Description booltrue if the operation succeeds; otherwise, false.
Exceptions | Edit this page View Source Set()Sets the state of the event to signaled, allowing one or more awaiters to proceed.
Declaration Returns Type Description booltrue if the operation succeeds; otherwise, false.
Exceptions | Edit this page View Source Set(bool)Sets the state of the event to signaled, allowing one or more awaiters to proceed; and, optionally, reverts the state of the event to initial state.
Declarationpublic bool Set(bool autoReset)
Parameters Type Name Description bool autoReset
true to reset this object to non-signaled state automatically; false to leave this object in signaled state.
Returns Type Description booltrue if the operation succeeds; otherwise, false.
Exceptions | Edit this page View Source WaitAsync(CancellationToken)Turns caller into idle state until the current event is set.
Declarationpublic ValueTask WaitAsync(CancellationToken token = default)
Parameters Type Name Description CancellationToken token
The token that can be used to abort wait process.
Returns Type Description ValueTaskThe task representing asynchronous result.
Exceptions | Edit this page View Source WaitAsync(TimeSpan, CancellationToken)Turns caller into idle state until the current event is set.
Declarationpublic ValueTask<bool> WaitAsync(TimeSpan timeout, CancellationToken token = default)
Parameters Type Name Description TimeSpan timeout
The interval to wait for the signaled state.
CancellationToken tokenThe token that can be used to abort wait process.
Returns Exceptions Implements Extension MethodsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4