/// <summary> /// Remove a task from the continuously running by its id. /// </summary> /// <param name="task"></param> /// <param name="id">Task id that runs in background.</param> public static void StopRunningInBackground(this Action task, string id = "") => GhostThread.RemoveTask(id);
public static void RunInBackground(this Func <Task> task, string id = "", int runningTime = 120) => GhostThread.AddTask(task, id, runningTime);