AsyncTimeout
Ecng.ComponentModel
Represents an asynchronous timeout for an operation.
コンストラクター
AsyncTimeout
public AsyncTimeout(TimeSpan value)
asyncTimeout = AsyncTimeout(value)
Initializes a new instance of the AsyncTimeout class with the specified timeout value.
- value
- The timeout duration. Must be greater than Zero.
プロパティ
メソッド
Register
public IDisposable Register(Action action)
result = asyncTimeout.Register(action)
Registers an action to be invoked when the timeout elapses.
- action
- The action to execute on timeout.
戻り値: A handle that cancels the pending timeout (so a completed operation can stop it from firing) and releases the underlying CancellationTokenSource when disposed.