|
@@ -20,6 +20,9 @@ public static class ConstraintsOptionsExtensions
|
|
return options;
|
|
return options;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Sets constraint based on memory usage in bytes.
|
|
|
|
+ /// </summary>
|
|
public static Options LimitMemory(this Options options, long memoryLimit)
|
|
public static Options LimitMemory(this Options options, long memoryLimit)
|
|
{
|
|
{
|
|
options.WithoutConstraint(x => x is MemoryLimitConstraint);
|
|
options.WithoutConstraint(x => x is MemoryLimitConstraint);
|
|
@@ -31,6 +34,9 @@ public static class ConstraintsOptionsExtensions
|
|
return options;
|
|
return options;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Sets constraint based on fixed time interval.
|
|
|
|
+ /// </summary>
|
|
public static Options TimeoutInterval(this Options options, TimeSpan timeoutInterval)
|
|
public static Options TimeoutInterval(this Options options, TimeSpan timeoutInterval)
|
|
{
|
|
{
|
|
if (timeoutInterval > TimeSpan.Zero && timeoutInterval < TimeSpan.MaxValue)
|
|
if (timeoutInterval > TimeSpan.Zero && timeoutInterval < TimeSpan.MaxValue)
|
|
@@ -40,6 +46,9 @@ public static class ConstraintsOptionsExtensions
|
|
return options;
|
|
return options;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Sets cancellation token to be observed. NOTE that this can be unreliable/imprecise on full framework due to timer logic.
|
|
|
|
+ /// </summary>
|
|
public static Options CancellationToken(this Options options, CancellationToken cancellationToken)
|
|
public static Options CancellationToken(this Options options, CancellationToken cancellationToken)
|
|
{
|
|
{
|
|
options.WithoutConstraint(x => x is CancellationConstraint);
|
|
options.WithoutConstraint(x => x is CancellationConstraint);
|