Class TaskManager
- Namespace
- Dynamicweb.Diagnostics.Tasks
- Assembly
- Dynamicweb.Diagnostics.dll
The Class TaskManager provides common operations on the Task objects
public static class TaskManager
- Inheritance
-
TaskManager
- Inherited Members
Properties
BaseFolder
Gets or sets the base folder in which diagnostics are stored.
public static string BaseFolder { get; set; }
Property Value
- string
- The base folder.
Context
Gets or sets the context that provides an independant set of parameters for tasks.
public static Context Context { get; set; }
Property Value
- Context
- The context.
Methods
GetActiveTaskNames()
Gets a list of names of active tasks.
public static IEnumerable<string> GetActiveTaskNames()
Returns
GetTaskInfo(string)
Gets the task information for a task with the given name. If a task with the given name does not exist,
null
is returned.public static TaskInfo? GetTaskInfo(string name)
Parameters
name
string- The name.
Returns
IsTaskActive(string)
Determines whether a task with the given name exists and is running.
public static bool IsTaskActive(string name)
Parameters
name
string- The name.
Returns
StartTask(string, Action)
Starts the given task and register the task with the given name.
public static TaskInfo StartTask(string name, Action task)
Parameters
Returns
StartTask(string, Action<Tracker>)
Starts the given task and register the task with the given name.
A Tracker is created and passed through.
The task can use the provided Tracker internally.
public static TaskInfo StartTask(string name, Action<Tracker> task)
Parameters
Returns
StartTask(string, Action<Tracker>, Tracker)
Starts the given task and register the task with the given name using the provided Tracker.
The task can use the provided Tracker internally.
If the given Tracker is
null
, a Tracker is created automatically.public static TaskInfo StartTask(string name, Action<Tracker> task, Tracker tracker)
Parameters
Returns
StartTask<T>(string, Action<Tracker, T>, T)
Starts the given task and register the task with the given name.
A Tracker is created and passed through.
The task can use the provided Tracker internally.
An provided object of type
T
is passed to the task.public static TaskInfo StartTask<T>(string name, Action<Tracker, T> task, T obj)
Parameters
Returns
Type Parameters
T
- The type of the object to pass to the task.
StartTask<T>(string, Action<Tracker, T>, Tracker, T)
Starts the given task and register the task with the given name.
The task can use the provided Tracker internally.
If the given Tracker is
null
, a Tracker is created automatically.
An provided object of type T
is passed to the task.public static TaskInfo StartTask<T>(string name, Action<Tracker, T> task, Tracker tracker, T obj)
Parameters
name
string- The name.
task
Action<Tracker, T>- The task.
tracker
Tracker- The tracker.
obj
T- The object.
Returns
Type Parameters
T
- The type of the object to pass to the task.