futureverse / futureverse/future

future() arguments for passing R options and environment variables

Open
#480 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
R
Stars
1k
Forks
92
PR merge metrics
No merged PRs in 30d

Description

There are cases where one needs to customize options and environment variables used by the future. This can be done by explicitly setting those in the future expression, but that might be tedious, especially to make sure that they are unset afterward. Having `future()` do it for us is easier and avoids some code clutter. Here's one idea:

```r
# Set env var 'FOO' with its currently set value, if set + set 'BAR' to "42"
f <- future(..., envvars = c("FOO", BAR = "42"))

# Set R options 'foo' with its currently set value, if set + set 'bar' to 42L
f <- future(..., options = c("foo", BAR = 42L))
```

These arguments should be exposed also in map-reduce APIs, e.g. **future.apply** and **furrr**.

# Possible concerns

* [ ] All types of options and environment variables should not be exported; is that something that **future** should monitor/protect again?
* [ ] In R, certain environment variables must be set before launching R; is that something that **future** should monitor/protect again?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the future() API and the map-reduce APIs in future.apply and furrr to understand how arguments are currently passed. Define the expected handling of R options and environment variables, including the two listed protection concerns, and confirm that the interface is consistent across these APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.