asyncfuture
asyncfuture copied to clipboard
How does one error a AsyncFuture::Deferred?
And how does one communicate that error? Is this what 'cancel' is for? - doesn't sound this way as cancel is the interface of the future not of the promise.
And a related question, having a failed QFuture
- how does one "rescue" it? - i.e.: having this chain:
return observe(reading).subscribe(updateCache).future();
- suppose reading
fails and suppose there is a way of correcting it:
return observe(reading).subscribe(updateCache, rescue).future();
the above doesn't work.
There's currently no error handling in AsyncFuture. You can handle errors in the QFuture type using std::variant or std::any. With Qt6 QFuture can handle failures with exceptions. I'm not sure if Qt6's QFuture is compatible with AsyncFuture. There's a bunch of feature overlap. But QFuture doesn't support combine().