with_progress_signal: Execute Function with Progress Reporting for Each Item

View source: R/progress_utils.R

with_progress_signalR Documentation

Execute Function with Progress Reporting for Each Item

Description

Helper function that wraps a function to report progress after each invocation. Useful for integrating progress reporting with purrr::map() or furrr::future_map().

Usage

with_progress_signal(.f, .p)

Arguments

.f

Function to wrap

.p

Progressor function created by create_progressor() or progressr::progressor()

Details

This is an internal utility function used by riemtan's parallel processing functions.

Value

A wrapped function that calls .f(x) and then signals progress via .p().

Examples

## Not run: 
progressr::handlers("progress")

result <- with_progress({
  p <- progressr::progressor(steps = 10)
  wrapped_fn <- with_progress_signal(sqrt, p)
  lapply(1:10, wrapped_fn)
})

## End(Not run)


riemtan documentation built on Nov. 11, 2025, 1:06 a.m.