Interface IHasRuleTimeout
An object (intended to be a validation rule) which can provide a timeout value, which will terminate the rule early (with an Errored outcome) if the timeout expires before the rule completes execution.
Namespace: CSF.Validation.Rules
Assembly: CSF.Validation.Abstractions.dll
Syntax
public interface IHasRuleTimeout
Methods
| Improve this Doc View SourceGetTimeout()
Gets the timeout value for the current rule.
Declaration
TimeSpan? GetTimeout()
Returns
Type | Description |
---|---|
System.Nullable<System.TimeSpan> | A timespan indicating the timeout duration, or a null reference if no timeout is applicable. |
Remarks
If this method returns non-null & the execution of the rule takes longer than this timeout value then:
The rule will immediately return an error result. Additionally the CancellationToken passed to the rule will be cancelled, allowing the rule logic to terminate early.