-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DESIGN: Future API - Minimal/Core/Essential API and Extended/Optional API #172
Comments
This was referenced Nov 30, 2017
For ropensci/drake#227, I am interested in detecting failed futures without having to look at the value. I think there is a need to learn when a future has crashed, for whatever reason. library(future)
plan(multicore)
f <- future({
stop("some kind of error")
})
resolved(f)
# [1] TRUE
f$state
# [1] "running" As I understand it, |
This was referenced Feb 6, 2018
HenrikBengtsson
changed the title
DESIGN: Future API - Minimal/Essential API and Extended/Optional API
DESIGN: Future API - Minimal/Core/Essential API and Extended/Optional API
Apr 22, 2018
Closed
This was referenced Jul 23, 2018
This was referenced Aug 25, 2018
This was referenced Dec 7, 2018
HenrikBengtsson
added a commit
that referenced
this issue
Oct 8, 2020
This was referenced Nov 28, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The future package receives many interesting and handy feature requests. Some of them are straighforward whereas others does not necessarily fit straight in. I'm creating this issue to clarify why it's not straightforward to implement these and what the alternatives going forward are, and to encourage further discussion and ideas.
Minimal Future API (aka Future API)
In it's most minimal and essential form, the Future API provides:
future()
- creates a future (on any future backend)value()
- collects the value of the future (waits for it to resolve if not already done)resolved()
- checks whether a future is resolved or not.On top of this, we have arguments controlling whether the future should be resolved lazily or eagerly, what or how globals are exported, polling and timeout strategies, etc.
I probably forgot something above, so please feel free to comment.
It is critical that this Minimal Future API can be supported by all future backends (including those not yet implemented by that may show up in the future). Because of this, the Minimal Future API is limited in what it can provide.
Examples of features that probably would fits in the Minimal Future API, but has not yet been added:
Capturing of standard error (in addition to the value) (Issue CONSISTENCY: Should all futures capture stdout & stderr as well? #67)unlikely, at least not until R itself supports it fullyOptional Future API
Any features related to futures that can not be supported by all backends belongs to what I consider an extended / optional API - let's call it the Optional Future API. Some features may be specific to a single backend while others to a majority of backends but not all.
Below is a set of features that fit into this category:
a <- future(1); b <- future(value(a))
- requiresb
to be able to "communicate" witha
(e.g. different machines)suspend(f)
(Issue WISH: Add method for interrupting / terminating a future #93)and standard errorstreams to the owner process (Issues Obtain function console output before it is resolved? #141, future_lapply() is silent for the multisession plan #171)identical(local, remote)
.Some of the referenced issues discuss why it's hard to implement the features in a generic fashion such that they would work with all future backends (i.e. why the cannot be added to the Minimal Future API but belongs to a set of optional features).
The text was updated successfully, but these errors were encountered: