A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://dotnet.github.io/dotNext/api/DotNext.Threading.Timeout.html below:

Struct Timeout | .NEXT

Struct Timeout

Helps to compute timeout for asynchronous operations.

Namespace: DotNext.Threading Assembly: DotNext.dll Syntax
public readonly struct Timeout
Constructors | Edit this page 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 | Edit this page View Source Timeout(TimeSpan, Timestamp)

Constructs a new timeout control object.

Declaration
public Timeout(TimeSpan timeout, Timestamp startedAt)
Parameters Type Name Description TimeSpan timeout

Max duration of operation.

Timestamp startedAt

The point in time when operation was started.

Exceptions | Edit this page View Source Timeout(TimeSpan, TimeProvider)

Constructs a new timeout control object.

Declaration
public Timeout(TimeSpan timeout, TimeProvider provider)
Parameters Type Name Description TimeSpan timeout

Max duration of operation.

TimeProvider provider

Time provider.

Exceptions Fields | Edit this page View Source InfiniteTicks

Represents a number of ticks in InfiniteTimeSpan.

Declaration
public const long InfiniteTicks = -10000
Field Value | Edit this page View Source MaxTimeoutParameterTicks

Represents maximum possible timeout value, in ticks, that can be passed to some methods such as Delay(TimeSpan) or CancelAfter(TimeSpan).

Declaration
public const long MaxTimeoutParameterTicks = 21474836470000
Field Value Properties | Edit this page View Source Expired

Gets expired timeout.

Declaration
public static Timeout Expired { get; }
Property Value | Edit this page View Source Infinite

Gets infinite timeout.

Declaration
public static Timeout Infinite { get; }
Property Value | Edit this page View Source IsExpired

Indicates that timeout is occurred.

Declaration
public bool IsExpired { get; }
Property Value | Edit this page View Source IsInfinite

Determines whether this timeout is infinite.

Declaration
public bool IsInfinite { get; }
Property Value | Edit this page View Source Value

Gets value of this timeout.

Declaration
public TimeSpan Value { get; }
Property Value Methods | Edit this page View Source ThrowIfExpired()

Throws TimeoutException if timeout occurs.

Declaration
public void ThrowIfExpired()
Exceptions | Edit this page View Source ThrowIfExpired(TimeProvider)

Throws TimeoutException if timeout occurs.

Declaration
public void ThrowIfExpired(TimeProvider provider)
Parameters Exceptions | Edit this page View Source ThrowIfExpired(TimeProvider, out TimeSpan)

Throws TimeoutException if timeout occurs.

Declaration
public void ThrowIfExpired(TimeProvider provider, out TimeSpan remainingTime)
Parameters Type Name Description TimeProvider provider

Time provider.

TimeSpan remainingTime

The remaining time before timeout.

Exceptions | Edit this page View Source ThrowIfExpired(out TimeSpan)

Throws TimeoutException if timeout occurs.

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

The remaining time before timeout.

Exceptions | Edit this page View Source TryGetRemainingTime(TimeProvider, out TimeSpan)

Gets the remaining time.

Declaration
public bool TryGetRemainingTime(TimeProvider provider, out TimeSpan remainingTime)
Parameters Type Name Description TimeProvider provider

Time provider.

TimeSpan remainingTime

The remaining time before timeout.

Returns Type Description bool

true if timeout hasn't happened yet; otherwise, false.

| Edit this page View Source TryGetRemainingTime(out TimeSpan)

Gets the remaining time.

Declaration
public bool TryGetRemainingTime(out TimeSpan remainingTime)
Parameters Type Name Description TimeSpan remainingTime

The remaining time before timeout.

Returns Type Description bool

true if timeout hasn't happened yet; otherwise, false.

| Edit this page View Source Validate(TimeSpan, string?)

Validates the timeout.

Declaration
public static void Validate(TimeSpan timeout, string? parameterName = null)
Parameters Type Name Description TimeSpan timeout

The timeout value.

string parameterName

The name of the timeout parameter passed by the caller.

Exceptions Operators | Edit this page View Source operator false(in 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 bool

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

| Edit this page View Source implicit operator TimeSpan(in Timeout)

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.

| Edit this page View Source operator true(in 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 bool

true, if timeout is reached; otherwise, false.

Extension Methods

RetroSearch 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