Package: fnware 0.1.0

fnware: Ready-Made Function Decorators

Ready-made function decorators for R, built on the 'adorn' framework. Covers resilience (retrying, timeouts, rate limiting, circuit breaking and fallbacks), caching, call logging, context managers and argument validation, with asynchronous versions for functions that return promises.

Authors:Dyfan Jones [aut, cre]

fnware_0.1.0.tar.gz
fnware_0.1.0.tar.gz(r-4.6-any)
fnware_0.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
fnware/json (API)

# Install 'fnware' in R:
install.packages('fnware', repos = c('https://dyfanjones.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/dyfanjones/fnware/issues

Pkgdown/docs site:https://dyfanjones.github.io

On CRAN:

Conda:

4.17 score 1 stars 11 scripts 72 exports 6 dependencies

Last updated from:4e5ee11f56. Checks:7 FAIL, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develFAIL135
source / vignettesOK195
linux-releaseFAIL128
macos-releaseFAIL104
macos-oldrelFAIL68
windows-develFAIL97
windows-releaseFAIL57
windows-oldrelFAIL108
wasm-releaseOK92

Exports::=%@%after_sleep_baseafter_sleep_fnafter_sleep_logafter_sleep_noneas_decoratorasync_cacheasync_circuit_breakerasync_disk_cacheasync_fallbackasync_log_callasync_lru_cacheasync_onceasync_rate_limitasync_retryasync_timeoutasync_timeout_baseasync_timeout_fnasync_timeout_laterasync_validate_returnbefore_sleep_basebefore_sleep_fnbefore_sleep_logbefore_sleep_nonecachecircuit_breakercontextmanagerdisk_cachefallbacklog_calllog_levelslogger_baselogger_fnlogger_messagelru_cacheoncerate_limitretryretry_allretry_baseretry_fnretry_if_errorretry_if_error_messageretry_if_resultretry_neverstop_after_attemptstop_after_delaystop_allstop_anystop_basestop_before_delaystop_fnstop_neverteardowntimeouttimeout_basetimeout_fntimeout_rtimeout_remainingvalidate_argsvalidate_returnwait_basewait_chainwait_combinewait_expwait_exp_jitterwait_fixedwait_fnwait_nonewait_randwith_context

Dependencies:adorncachemfastmaprlangS7withr

Logging calls
Levels | Traces | Loggers | Using a logging package | Promises

Last update: 2026-11-10
Started: 2026-11-05

Asynchronous decorators
Why not the blocking version? | Stacking

Last update: 2026-11-05
Started: 2026-11-05

Choosing and stacking decorators
Which decorator do I want? | Stacking order

Last update: 2026-11-05
Started: 2026-11-05

Fallbacks and running once
Returning a default | Stacking with retry and the circuit breaker | Promises | Running once

Last update: 2026-11-05
Started: 2026-11-05

Retrying failing calls
A function that fails at first | Deciding when to stop | Deciding how long to wait | Deciding what to retry | Seeing what is happening | Bounding hung calls | Passing the time on | What it cannot stop | Writing a timeout method | Retrying without blocking | Bounding a slow promise | Writing your own strategies | Putting it together | Notes

Last update: 2026-11-05
Started: 2026-10-31

Validating arguments and results
What counts as a validator | Messages | Which arguments are checked | Validating the result | Handling failures | Combining with other decorators | Promises

Last update: 2026-11-05
Started: 2026-10-31

Caching results
In memory | What counts as the same call | What is and is not cached | Limiting size | On disk | Changing the function | Choosing a file format | With promises | When not to cache | Choosing

Last update: 2026-11-05
Started: 2026-10-31

Context managers
The problem with on.exit() | What withr already does | What contextmanager adds | A worked comparison | With withr, by hand | With contextmanager | When not to use it | Behaviour worth knowing | How it works

Last update: 2026-11-05
Started: 2026-10-31

Failing fast with a circuit breaker
A service that is down | The three states | What counts as a failure | Handling an open circuit | Using it with retry | With promises | Notes

Last update: 2026-11-05
Started: 2026-10-31

Readme and manuals

Help Manual

Help pageTopics
Write your own stop, wait, retry and hook strategiesafter_sleep_base after_sleep_fn before_sleep_base before_sleep_fn extending_retry retry_base retry_fn stop_base stop_fn wait_base wait_fn
Run a hook after 'retry()' sleepsafter_sleep_log after_sleep_none
Use a context manager as a decoratoras_decorator
Stop calling an asynchronous function that keeps failingasync_circuit_breaker
Return a default when an asynchronous function failsasync_fallback
Log the calls to an asynchronous functionasync_log_call
Cache the results of asynchronous functionsasync_cache async_disk_cache async_lru_cache
Run an asynchronous function only onceasync_once
Limit how often an asynchronous function can be calledasync_rate_limit
Retry a function without blockingasync_retry
Bound how long an asynchronous call can takeasync_timeout async_timeout_base async_timeout_fn async_timeout_later
Validate the value an asynchronous function resolves toasync_validate_return
Run a hook before 'retry()' sleepsbefore_sleep_log before_sleep_none
Stop calling a function that keeps failingcircuit_breaker
Write setup and teardown oncecontextmanager teardown
Use a logging package with 'log_call()'extending_log
Write your own timeout methodextending_timeout timeout_base timeout_fn
Return a default when a function failsfallback
Log the calls to a functionlog_call
The level of each event 'log_call()' logslog_levels
Loggerslogger_base logger_fn logger_message
Cache function resultscache disk_cache lru_cache
Run a function only onceonce
Limit how often a function can be calledrate_limit
Retry a function when it failsretry
Retry conditionsretry_all retry_if_error retry_if_error_message retry_if_result retry_never
Stop conditionsstop_after_attempt stop_after_delay stop_all stop_any stop_before_delay stop_never
Bound how long a call can runtimeout timeout_r timeout_remaining
Validate arguments and return valuesvalidate_args validate_return
Wait strategieswait_chain wait_combine wait_exp wait_exp_jitter wait_fixed wait_none wait_rand
Run code inside a contextwith_context