Learn R Programming

⚠️There's a newer version (1.40.0) of this package.Take me there.

future (version 1.1.0)

A Future API for R

Description

A Future API for R is provided. In programming, a future is an abstraction for a value that may be available at some point in the future. The state of a future can either be unresolved or resolved. As soon as it is resolved, the value is available. Futures are useful constructs in for instance concurrent evaluation, e.g. parallel processing and distributed processing on compute clusters. The purpose of this package is to provide a lightweight interface for using futures in R. Functions 'future()' and 'value()' exist for creating futures and requesting their values, e.g. 'f <- future({ mandelbrot(-0.75, 0, side=3) })' and 'v <- value(f)'. The 'resolved()' function can be used to check if a future is resolved or not. An infix assignment operator '%<-%' exists for creating futures whose values are accessible by the assigned variables (as promises), e.g. 'v %<-% { mandelbrot(-0.75, 0, side=3) }'. This package implements synchronous "lazy" and "eager" futures, and asynchronous "multicore", "multisession" and ad hoc "cluster" futures. Globals variables and functions are automatically identified and exported. Required packages are attached in external R sessions whenever needed. All types of futures are designed to behave the same such that the exact same code work regardless of futures used or number of cores, background sessions or cluster nodes available. Additional types of futures are provided by other packages enhancing this package.

Copy Link

Version

Install

install.packages('future')

Monthly Downloads

266,253

Version

1.1.0

License

LGPL (>= 2.1)

Issues

Pull Requests

Stars

Forks

Maintainer

Henrik Bengtsson

Last Published

October 10th, 2016

Functions in future (1.1.0)

ConstantFuture-class

A future with a constant value
availableCores

Get number of available cores on current machine
eager

Create an eager future whose value will be resolved immediately
flapply

Apply a Function over a List or Vector via Futures
EagerFuture-class

An eager future is a future whose value will be resolved immediately
backtrace

Back trace the expressions evaluated before a condition was caught
future

Create a future
Future-class

A future represents a value that will be available at some point in the future
ClusterFuture-class

A cluster future is a future whose value will be resolved asynchroneously in a parallel process
cluster

Create a cluster future whose value will be resolved asynchroneously in a parallel process
futures

Gets all futures in an object
futureOf

Get the future of a future variable
FutureError

An error occurred while trying to evaluate a future
%tweak%

Temporarily tweaks the arguments of the current strategy
getExpression

Inject code for the next type of future to use for nested futures
%label%

Specify label for a future assignment
%plan%

Use a specific plan for a future assignment
%globals%

Specify globals for a future assignment
future.options

Options used for futures
getGlobalsAndPackages

Retrieves global variables of an expression and their associated packages
multiprocess

Create a multiprocess future whose value will be resolved asynchroneously using multicore or a multisession evaluation
LazyFuture-class

A lazy future is a future whose value will be resolved at the time when it is requested
MultiprocessFuture-class

An multiprocess future is a future whose value will be resolved asynchroneously in a parallel process
multicore

Create a multicore future whose value will be resolved asynchroneously in a forked parallel process
plan

Plan how to resolve a future
MulticoreFuture-class

An multicore future is a future whose value will be resolved asynchroneously in a parallel process
multisession

Create a multisession future whose value will be resolved asynchroneously in a parallel R session
nbrOfWorkers

Gets the number of workers available
lazy

Create a lazy future whose value will be resolved at the time when requested
mandelbrot

Mandelbrot convergence counts
tweak_parallel_PSOCK

Tweak PSOCK backend of the parallel package
tweak

Tweaks a future function by adjusting its default arguments
UniprocessFuture-class

An uniprocess future is a future whose value will be resolved synchroneously in the current process
usedCores

Get number of cores currently used
values

Gets all values in an object
value.Future

The value of a future
resolve

Wait until all existing futures in an environment are resolved
remote

Create a remote future whose value will be resolved asynchroneously in a remote process
resolved

Check whether a future is resolved or not
requestCore

Request a core for multicore processing
run.Future

Run a future
supportsMulticore

Check whether multicore processing is supported or not