3 ms·
There's absolutely nothing about this that would benefit from having promises - none of the operations performed are blocking. It's constraint solving, not I/O.
by dymk 10y ago
There's absolutely nothing about this that would benefit from having promises - none of the operations performed are blocking. It's constraint solving, not I/O.
- formula1 10y agoI was unfamiliar with the use case that this offers and thought it was a mostly useless replacement or what we already have available.
- hrjet 10y agoPromises can be helpful in a pure CPU bound workload as well: they help to avoid blocking the main thread, by yielding more often. This is typically done by breaking a long running computation into a series of sub-computations that are scheduled on a timer, and the top level API returns a Promise that completes when all computations are over. The same goal could also be achieved with multiple threads (webworkers for example). But the promises and async/await syntax is more convenient.