pausables {async}R Documentation

Pausable functions.


async and gen rely on "pausable" workalikes for R functions like if, while, and so on. pausables() scans for and returns a list of all pausable functions visible in the present environment and in attached packages.


pausables(envir = caller(), packages = base::.packages())



The environment to search (defaulting to the calling environment).


Which packages to search; defaults to currently loaded packages. You can scan all packages with pausables(packages=base::.packages(all.available=TRUE))


It is possible for a third party package to define pausable functions. To do this:

  1. Define and export a function yourname and an ordinary R implementation (the pausable version is only used when there is an await or yield in the arguments.)

  2. Also define a function yourname_cps in your package namespace. (It does not need to be exported.) yourname_cps should have the pausable (callback based) implementation.

The API for pausable functions is not yet fixed, but it is described in source file cps.r along with implementations for R builtins.


A list of expressions (either names or ::: calls)

[Package async version 0.2.1 Index]