with_graceful_interrupt: Execute expression with graceful interrupt handling

View source: R/interrupt.R

with_graceful_interruptR Documentation

Execute expression with graceful interrupt handling

Description

Wraps an expression so that SIGINT (Ctrl+C) is caught gracefully: progress is reported, resources are cleaned up, and the function returns NULL instead of throwing an error.

Usage

with_graceful_interrupt(expr, total = 0)

Arguments

expr

Expression to evaluate.

total

Integer. Total items for progress tracking (batch mode).

Value

Result of expr, or NULL if interrupted.


Rclade documentation built on Sept. 26, 2026, 5:07 p.m.