Closed miniBill closed 7 months ago
Timing stuff is a little bit weird with BackendTask
because it executes things on one level before moving on to the next, so I'd be somewhat reluctant to add that because it might mislead people. There isn't super fine-grained control over timing because of that, and having race
might make it appear that there is more granular control over those things. Also I think that cancelling a backend task gets tricky because it would need a pretty different architecture, and people might also expect race
to cancel the "loser" in the race. I'll close this issue for those reasons, but happy to discuss more if you have other thoughts.
race : BackendTask error a -> BackendTask error a -> BackendTask error a
would run two tasks in parallel and return when the first one returns.This is useful for, for example, timeouts, or watching multiple files/sockets.