HenrikBengtsson / future

:rocket: R package: future: Unified Parallel and Distributed Processing in R for Everyone
https://future.futureverse.org
951 stars 83 forks source link

Backend API: Formally define the "state" of a future #667

Open HenrikBengtsson opened 1 year ago

HenrikBengtsson commented 1 year ago

The state of a future is stored in the internal state field, which takes a character string. Supported values are:

It is to be decided if:

should also be added to the above list. They are really not needed, because they could be inferred if we collect the FutureResults object and inspect that.

In the past, this was mostly specific to the future package, but with the move to a more generic backend solution (e.g. lazy futures are vanilla Future objects until launched, make it possible to relaunch failed Future objects, etc.) we need to tighten this up and standardize it.

HenrikBengtsson commented 1 year ago

2023-05-26: Running revdep checks with R_FUTURE_STATE_ONINVALID=error reveals that civis 3.1.2 [2023-03-31] sets the future state to "cancelled" in its cancel() for CivisFuture, cf. https://github.com/civisanalytics/civis-r/blob/51c2e2270ed52a977ebbba869a69a76f1a7311cc/R/civis_future.R#L160-L163.