Shared initialization timeout budget for Grabbers.IFrameGrabber.OpenAsync and first-frame wait. Time spent inside RunOutsideTimeoutAsync does not consume the budget (for example long-running host prompts such as OS permission dialogs). A timeout of zero or less means unlimited.
More...
|
| void | Dispose () |
| | Stops the budget stopwatch and marks this instance disposed.
|
| |
| async Task | RunOutsideTimeoutAsync (Func< CancellationToken, Task > action, CancellationToken cancellationToken) |
| | Runs action without consuming the timeout budget. User cancellation is still honored via cancellationToken . Nested calls are not supported.
|
| |
| async Task< T > | RunOutsideTimeoutAsync< T > (Func< CancellationToken, Task< T > > action, CancellationToken cancellationToken) |
| | Runs action without consuming the timeout budget and returns its result. User cancellation is still honored via cancellationToken . Nested calls are not supported.
|
| |
|
| static InitTimeoutBudget | FromMilliseconds (int timeoutMs, CancellationToken cancellationToken=default) |
| | Creates a budget with the specified total timeout in milliseconds. A value less than or equal to zero means no timeout (unlimited).
|
| |
|
| bool | IsExpired [get] |
| | Gets whether the Open / first-frame wall-clock budget has been exhausted. Always false when the timeout is unlimited. This is the only timeout signal; Token is not canceled when the budget expires.
|
| |
| int | RemainingMilliseconds [get] |
| | Gets the remaining budget in milliseconds, or int.MaxValue when unlimited.
|
| |
| CancellationToken | Token [get] |
| | Gets the cooperative user cancellation token passed to FromMilliseconds. This token is not canceled when the wall-clock budget is exhausted; use IsExpired as the Open / first-frame deadline. Do not use this token as a timeout signal.
|
| |
Shared initialization timeout budget for Grabbers.IFrameGrabber.OpenAsync and first-frame wait. Time spent inside RunOutsideTimeoutAsync does not consume the budget (for example long-running host prompts such as OS permission dialogs). A timeout of zero or less means unlimited.
◆ Dispose()
| void OpenCVForUnity.Extensions.SourceToMat.InitTimeoutBudget.Dispose |
( |
| ) |
|
Stops the budget stopwatch and marks this instance disposed.
◆ FromMilliseconds()
| static InitTimeoutBudget OpenCVForUnity.Extensions.SourceToMat.InitTimeoutBudget.FromMilliseconds |
( |
int | timeoutMs, |
|
|
CancellationToken | cancellationToken = default ) |
|
static |
Creates a budget with the specified total timeout in milliseconds. A value less than or equal to zero means no timeout (unlimited).
- Parameters
-
| timeoutMs | Total shared budget in milliseconds for open and first-frame wait. |
| cancellationToken | User cancellation token exposed as Token. |
- Returns
- A new InitTimeoutBudget instance.
◆ RunOutsideTimeoutAsync()
| async Task OpenCVForUnity.Extensions.SourceToMat.InitTimeoutBudget.RunOutsideTimeoutAsync |
( |
Func< CancellationToken, Task > | action, |
|
|
CancellationToken | cancellationToken ) |
Runs action without consuming the timeout budget. User cancellation is still honored via cancellationToken . Nested calls are not supported.
Do not use ConfigureAwait(false) on the inner await. Callers that depend on SynchronizationContext marshaling must resume on the same context after action completes (including after long-running host work such as OS permission prompts). Deadline checks remain IsExpired (the stopwatch is paused); Token is not canceled by elapsed time.
- Parameters
-
| action | The asynchronous work to run outside the timeout budget. |
| cancellationToken | Cancellation token for the outside work (typically the user token). |
- Returns
- A task that completes when action completes.
◆ RunOutsideTimeoutAsync< T >()
Runs action without consuming the timeout budget and returns its result. User cancellation is still honored via cancellationToken . Nested calls are not supported.
Do not use ConfigureAwait(false) on the inner await. Callers that depend on SynchronizationContext marshaling must resume on the same context after action completes (including after long-running host work such as OS permission prompts). Deadline checks remain IsExpired (the stopwatch is paused); Token is not canceled by elapsed time.
- Template Parameters
-
| T | The result type of action . |
- Parameters
-
| action | The asynchronous work to run outside the timeout budget. |
| cancellationToken | Cancellation token for the outside work (typically the user token). |
- Returns
- A task that produces the result of action .
◆ IsExpired
| bool OpenCVForUnity.Extensions.SourceToMat.InitTimeoutBudget.IsExpired |
|
get |
Gets whether the Open / first-frame wall-clock budget has been exhausted. Always false when the timeout is unlimited. This is the only timeout signal; Token is not canceled when the budget expires.
◆ RemainingMilliseconds
| int OpenCVForUnity.Extensions.SourceToMat.InitTimeoutBudget.RemainingMilliseconds |
|
get |
Gets the remaining budget in milliseconds, or int.MaxValue when unlimited.
◆ Token
| CancellationToken OpenCVForUnity.Extensions.SourceToMat.InitTimeoutBudget.Token |
|
get |
Gets the cooperative user cancellation token passed to FromMilliseconds. This token is not canceled when the wall-clock budget is exhausted; use IsExpired as the Open / first-frame deadline. Do not use this token as a timeout signal.
The documentation for this class was generated from the following file: