caolan / async

Async utilities for node and the browser
http://caolan.github.io/async/
MIT License
28.18k stars 2.41k forks source link

A rollback option for seq, compose, parallel series etc. #1773

Closed from-nibly closed 2 years ago

from-nibly commented 2 years ago

I actually haven't used this library before. I found it because I was looking for a utility to do async rollbacks.

Essentially I'm looking for something to behave similar to a transaction system in a database. Where if I do 6 parallel things and one of them fails I don't want to have "done" any of them.

I found this but it hasn't been touched since 2013? https://github.com/rossj/async-rollback

Are there any plans/is there any interest in adding a rollback system?

something like instead of passing a single function just pass two in an object or a tuple that would represent do, undo.

If any of the do's fail then run all the undo functions for all the do functions that were at least started?

aearly commented 2 years ago

This sounds cool, but also complicated and tricky. Would be a lot of work to build and maintain.