Show / Hide Table of Contents

Struct Timeout

Helps to compute timeout for asynchronous operations.

Inherited Members
ValueType.Equals(Object)
ValueType.GetHashCode()
ValueType.ToString()
Object.Equals(Object, Object)
Object.GetType()
Object.ReferenceEquals(Object, Object)
Namespace: DotNext.Threading
Assembly: DotNext.dll
Syntax
public struct Timeout

Constructors

| Improve this Doc View Source

Timeout(TimeSpan)

Constructs a new timeout control object.

Declaration
public Timeout(TimeSpan timeout)
Parameters
Type Name Description
TimeSpan timeout

Max duration of operation.

Exceptions
Type Condition
ArgumentOutOfRangeException

timeout is negative.

Properties

| Improve this Doc View Source

IsExpired

Indicates that timeout is occurred.

Declaration
public bool IsExpired { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

IsInfinite

Determines whether this timeout is infinite.

Declaration
public bool IsInfinite { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

RemainingTime

Gets the remaining time.

Declaration
public TimeSpan? RemainingTime { get; }
Property Value
Type Description
Nullable<TimeSpan>

The remaining time; or null if timeout occurs.

| Improve this Doc View Source

Value

Gets value of this timeout.

Declaration
public TimeSpan Value { get; }
Property Value
Type Description
TimeSpan

Methods

| Improve this Doc View Source

ThrowIfExpired()

Throws TimeoutException if timeout occurs.

Declaration
public void ThrowIfExpired()
| Improve this Doc View Source

ThrowIfExpired(out TimeSpan)

Throws TimeoutException if timeout occurs.

Declaration
public void ThrowIfExpired(out TimeSpan remaining)
Parameters
Type Name Description
TimeSpan remaining

The remaining time before timeout.

Operators

| Improve this Doc View Source

False(Timeout)

Indicates that timeout is not reached.

Declaration
public static bool operator false (in Timeout timeout)
Parameters
Type Name Description
Timeout timeout

Timeout control object.

Returns
Type Description
Boolean

false, if timeout is not reached; otherwise, false.

| Improve this Doc View Source

Implicit(Timeout to TimeSpan)

Extracts original timeout value from this object.

Declaration
public static implicit operator TimeSpan(in Timeout timeout)
Parameters
Type Name Description
Timeout timeout

Timeout control object.

Returns
Type Description
TimeSpan

The original timeout value.

| Improve this Doc View Source

True(Timeout)

Indicates that timeout is reached.

Declaration
public static bool operator true (in Timeout timeout)
Parameters
Type Name Description
Timeout timeout

Timeout control object.

Returns
Type Description
Boolean

true, if timeout is reached; otherwise, false.

Extension Methods

Sequence.Skip<TEnumerator, T>(ref TEnumerator, Int32)
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX