Show / Hide Table of Contents

Class AsyncEvent

Represents various extension methods for types implementing IAsyncEvent interface.

Inheritance
Object
AsyncEvent
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: DotNext.Threading
Assembly: DotNext.Threading.dll
Syntax
public static class AsyncEvent

Methods

| Improve this Doc View Source

WaitAsync(IAsyncEvent)

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

Declaration
public static Task WaitAsync(this IAsyncEvent event)
Parameters
Type Name Description
IAsyncEvent event

An event to synchronize with.

Returns
Type Description
Task

A promise of signaled state.

Remarks

This method can potentially blocks execution of async flow infinitely.

| Improve this Doc View Source

WaitAsync(IAsyncEvent, CancellationToken)

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

Declaration
public static Task WaitAsync(this IAsyncEvent event, CancellationToken token)
Parameters
Type Name Description
IAsyncEvent event

An event to synchronize with.

CancellationToken token

The token that can be used to abort wait process.

Returns
Type Description
Task

A promise of signaled state.

Remarks

This method can potentially blocks execution of async flow infinitely.

| Improve this Doc View Source

WaitAsync(IAsyncEvent, TimeSpan)

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

Declaration
public static Task<bool> WaitAsync(this IAsyncEvent event, TimeSpan timeout)
Parameters
Type Name Description
IAsyncEvent event

An event to synchronize with.

TimeSpan timeout

The interval to wait for the signaled state.

Returns
Type Description
Task<Boolean>

true if signaled state was set; otherwise, false.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX