Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.promise

Coerce to a promise


Description

Use is.promise to determine whether an R object is a promise. Use as.promise (an S3 generic method) to attempt to coerce an R object to a promise. This package includes support for converting future::Future objects into promises.

Usage

is.promise(x)

is.promising(x)

as.promise(x)

Arguments

x

An R object to test or coerce.

Value

as.promise returns a promise object, or throws an error if the object cannot be converted.

is.promise returns TRUE if the given value is a promise object, and FALSE otherwise.

is.promising returns TRUE if the given value is a promise object or if it can be converted to a promise object using as.promise, and FALSE otherwise.


promises

Abstractions for Promise-Based Asynchronous Programming

v1.2.0.1
MIT + file LICENSE
Authors
Joe Cheng [aut, cre], RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.