Open domenic opened 10 years ago
The big question here imo is whether we should make them thenables, or have explicit conversion with a Task<T>#toPromise() → Promise<T>
Maintaining the cancelability of a task even if it is returned asynchronously seems like a useful property to me.
The interface proposed by @kriskowal is literally the same thing we came up with (sans the ETA stuff), so that's probably what we should go for.
@kriskowal makes the case here: https://github.com/kriskowal/gtor/blob/master/cancelation.md
After thinking on this for a while, it's pretty elegant. By re-using the
.then
interface, they can be converted to promises easily (viaPromise.resolve(theTask)
), which makes them multicast.@nathan7 and I were talking about this at NodeConf EU; tagging him in.