Closed devonoel closed 9 years ago
Couple notes on how this would work, to keep my brain on task:
.load
should initialize a locked
field in each task object loaded in to global.taskList
with initial value false
.exec
should check the lock before running a task, switch it on and start running the task if unlocked, and emit an event if the lock is engaged and return without running the task.exec
's callback should unlock the task, regardless of whether it completes successfully or throws an errorActually, on second thought, I hadn't considered a situation where somebody might want to say, run a deploy task against two separate stages at once using variables. I think I'll close this issue for now, it adds a lot of arguably unnecessary complexity.
Consider implementing a lock or queue for tasks. Does it make sense to only allow each individual task to be run by one person at a time, or is that something that should be handled by the client?