Abstractions for Promise-Based Asynchronous Programming
Overview
Provides fundamental abstractions for doing asynchronous programming in R using promises. Asynchronous programming is useful for allowing a single R process to orchestrate multiple tasks in the background while also attending to something else. Semantics are similar to 'JavaScript' promises, but with a syntax that is idiomatic R.
OpenTelemetry
promises now integrates with the otel package to provide observability and tracing for asynchronous operations.
local_otel_promise_domain()adds an OpenTelemetry span promise domain to the local scope. This is useful for{coro}operations where encapsulating the coro operations insidewith_*()methods is not allowed. (#179)with_otel_promise_domain()creates a promise domain that restores the currently active OpenTelemetry span from when a call tothen()is executed. This enables proper tracing context across asynchronous operations. (#173)with_otel_span()creates an OpenTelemetry span, executes the given expression within it, and ends the span when the expression completes. This function handles both synchronous and asynchronous (promise-based) operations. For promises, the span is automatically ended when the promise resolves or rejects. To access the OpenTelemetry span within your expression, useotel::get_current_span(). (#198)
Show all changes in 1.5.0Hide the rest of the changes in 1.5.0
New features
- Promises are now simple classed environments rather than R6 classes. This reduces their creation overhead by up to 10x, thereby substantially improving performance. (#191)
Life cycle changes
local_ospan_promise_domain(),with_ospan_async(), andwith_ospan_promise_domain()are deprecated in favor oflocal_otel_promise_domain(),with_otel_span(), andwith_otel_promise_domain()respectively. (#198)
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-11
- ERROR12 OK, 1 ERROR2026-07-10
- OK13 OK2026-07-01
Show 6 earlier changesHide 6 earlier changes
- ERROR12 OK, 1 ERROR2026-06-29
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-03-10
Documentation
- Help pages
- 17 (5 internal)includes a package overview page
- Examples that run
- 67%6 run in a plain check · 3 never run
- Exported functions with examples
- 64%
- Documented parameters
- 92%
- Return-value docs
- 58%
- Help pages citing references
- 0%
- Advanced future and promises usage HTML
- An informal introduction to async programming HTML
- Case study: converting a Shiny app to async HTML
- Combining promises HTML
- Launching tasks with future HTML
- Launching tasks with mirai HTML
- Using promises with Shiny HTML
- Why use promises? HTML
- Working with promises in R HTML
Downloads
Repository
- PRs merged (all time)
- 90%
- Median days to close, 50 most recently updated closed issues
- 12
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
8 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/rstudio/promises on 2026-10-21.
Show all practicesHide 1 practice
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2025-07-31Seen in the repository: CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claude
- GitHub Copilotfirst seen 2025-08-28Seen in the repository: .github/copilot-instructions.mdPull request: opened by its own accountCommits: 2 by its own account · at least 3 crediting it in the message
Dependencies
Installing promises adds 9 packages (6 with compiled code, 3.8 MB of source tarballs). Heaviest: Rcpp 1.8 MB, rlang 766 KB, cli 629 KB.
Show the 48 most downloaded packagesHide the 48 most downloaded packages
Code & Tests
People & History
Previously maintained by Joe Cheng (1.0.1 to 1.3.3).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 1.5.0Latest2025-11-01 · current release · diff ↗ ·
added 3 exports
local_otel_promise_domain, with_otel_promise_domain, with_otel_span - 1.4.02025-10-22 · diff ↗ ·
added 4 exports
hybrid_then, local_ospan_promise_domain, with_ospan_async, with_ospan_promise_domain - 1.3.32025-05-29 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 1.3.22024-11-28 · diff ↗
- 1.3.12024-11-26 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.3.02024-04-05 · diff ↗
- 1.2.12023-08-10 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- 1.2.0.1
- 1.1.12020-06-09 · diff ↗
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2018-04-13
- Total releases
- 11 / 8 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 3.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("promises")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.