Table of Contents

Class TimedOperation

Namespace
The.Logging
Assembly
Instagile.dll
public static class TimedOperation
Inheritance
TimedOperation
Inherited Members

Methods

Execute(string, Action<CancellationToken>, Func<string>, TimeSpan, ILogger, CancellationToken)

public static void Execute(string name, Action<CancellationToken> run, Func<string> getDescription, TimeSpan threshold, ILogger logger, CancellationToken ct)

Parameters

name string
run Action<CancellationToken>
getDescription Func<string>
threshold TimeSpan
logger ILogger
ct CancellationToken

ExecuteAsync(string, Func<CancellationToken, Task>, Func<string>, TimeSpan, ILogger, CancellationToken, bool)

public static Task ExecuteAsync(string name, Func<CancellationToken, Task> run, Func<string> getDescription, TimeSpan threshold, ILogger logger, CancellationToken ct, bool logCancellation = false)

Parameters

name string
run Func<CancellationToken, Task>
getDescription Func<string>
threshold TimeSpan
logger ILogger
ct CancellationToken
logCancellation bool

Returns

Task

ExecuteAsync(string, Func<AnonymousEnvironment, Task>, Func<string>, TimeSpan, AnonymousEnvironment)

public static Task ExecuteAsync(string name, Func<AnonymousEnvironment, Task> run, Func<string> getDescription, TimeSpan threshold, AnonymousEnvironment env)

Parameters

name string
run Func<AnonymousEnvironment, Task>
getDescription Func<string>
threshold TimeSpan
env AnonymousEnvironment

Returns

Task

ExecuteAsync(string, Func<CallbackEnvironment, Task>, Func<string>, TimeSpan, CallbackEnvironment)

public static Task ExecuteAsync(string name, Func<CallbackEnvironment, Task> run, Func<string> getDescription, TimeSpan threshold, CallbackEnvironment env)

Parameters

name string
run Func<CallbackEnvironment, Task>
getDescription Func<string>
threshold TimeSpan
env CallbackEnvironment

Returns

Task

ExecuteAsync<T>(string, Func<CancellationToken, Task<T>>, Func<string>, TimeSpan, ILogger, CancellationToken)

public static Task<T> ExecuteAsync<T>(string name, Func<CancellationToken, Task<T>> run, Func<string> getDescription, TimeSpan threshold, ILogger logger, CancellationToken ct)

Parameters

name string
run Func<CancellationToken, Task<T>>
getDescription Func<string>
threshold TimeSpan
logger ILogger
ct CancellationToken

Returns

Task<T>

Type Parameters

T

ExecuteAsync<T>(string, Func<AnonymousEnvironment, Task<T>>, Func<string>, TimeSpan, AnonymousEnvironment)

public static Task<T> ExecuteAsync<T>(string name, Func<AnonymousEnvironment, Task<T>> run, Func<string> getDescription, TimeSpan threshold, AnonymousEnvironment env)

Parameters

name string
run Func<AnonymousEnvironment, Task<T>>
getDescription Func<string>
threshold TimeSpan
env AnonymousEnvironment

Returns

Task<T>

Type Parameters

T

ExecuteAsync<T>(string, Func<CallbackEnvironment, Task<T>>, Func<string>, TimeSpan, CallbackEnvironment)

public static Task<T> ExecuteAsync<T>(string name, Func<CallbackEnvironment, Task<T>> run, Func<string> getDescription, TimeSpan threshold, CallbackEnvironment env)

Parameters

name string
run Func<CallbackEnvironment, Task<T>>
getDescription Func<string>
threshold TimeSpan
env CallbackEnvironment

Returns

Task<T>

Type Parameters

T

ExecuteEnumerable<T>(string, Func<CancellationToken, IEnumerable<T>>, Func<string>, TimeSpan, ILogger, CancellationToken)

public static IEnumerable<T> ExecuteEnumerable<T>(string name, Func<CancellationToken, IEnumerable<T>> run, Func<string> getDescription, TimeSpan threshold, ILogger logger, CancellationToken ct)

Parameters

name string
run Func<CancellationToken, IEnumerable<T>>
getDescription Func<string>
threshold TimeSpan
logger ILogger
ct CancellationToken

Returns

IEnumerable<T>

Type Parameters

T

Remarks

Only times the initial enumerable/enumerator generation, not calls to MoveNext().

Execute<T>(string, Func<CancellationToken, T>, Func<string>, TimeSpan, ILogger, CancellationToken)

public static T Execute<T>(string name, Func<CancellationToken, T> run, Func<string> getDescription, TimeSpan threshold, ILogger logger, CancellationToken ct)

Parameters

name string
run Func<CancellationToken, T>
getDescription Func<string>
threshold TimeSpan
logger ILogger
ct CancellationToken

Returns

T

Type Parameters

T

Execute<T>(string, Func<CallbackEnvironment, T>, Func<string>, TimeSpan, CallbackEnvironment)

public static T Execute<T>(string name, Func<CallbackEnvironment, T> run, Func<string> getDescription, TimeSpan threshold, CallbackEnvironment env)

Parameters

name string
run Func<CallbackEnvironment, T>
getDescription Func<string>
threshold TimeSpan
env CallbackEnvironment

Returns

T

Type Parameters

T