-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
49 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
local M = {} | ||
|
||
function M.dispose_all_tasks() | ||
--- Iterate over all tasks and run an action on each one | ||
--- @param actionName string | ||
function M.run_on_every_task(actionName) | ||
local status, overseer = pcall(require, 'overseer') | ||
if not status then | ||
return | ||
end | ||
|
||
local tasks = overseer.list_tasks({ unique = false }) | ||
for _, task in ipairs(tasks) do | ||
overseer.run_action(task, 'dispose') | ||
overseer.run_action(task, actionName) | ||
end | ||
end | ||
|
||
--- Dispose all tasks | ||
function M.dispose_all_tasks() | ||
M.run_on_every_task('dispose') | ||
end | ||
|
||
--- Stop all tasks | ||
function M.stop_all_tasks() | ||
M.run_on_every_task('stop') | ||
end | ||
|
||
return M |