AppManager: AppManager

AppManagerR Documentation

AppManager

Description

Manage shiny apps running in background tasks.

Public fields

apps

(list) list of running shiny apps named for their

Methods

Public methods


Method print()

print method for the AppManager class

Usage
AppManager$print(x, ...)
Arguments
x

self

...

ignored


Method register_app()

Register an app

Usage
AppManager$register_app(port, app)
Arguments
port

TCP port the app is listening on (e.g., 3000)

app

callr::r_process for a Shiny app

Returns

nothing returned


Method retrieve_app()

Retrieve a registered app

Usage
AppManager$retrieve_app(port)
Arguments
port

TCP port the app is listening on (e.g., 3000)

Returns

callr::r_process for a Shiny app


Method view_app()

View background Shiny application

Usage
AppManager$view_app(port)
Arguments
port

TCP port the app is listening on (e.g., 3000)

Returns

(Invisibly) The application's URL.


Method kill_app()

Kill an app's process and deregister it

Usage
AppManager$kill_app(port, verbose = TRUE)
Arguments
port

TCP port the app is listening on (e.g., 3000)

verbose

(logical) Should messages be printed to the console?

Returns

TRUE if the process was terminated, and FALSE if it was not


Method kill_all_apps()

Kill all registered apps

Usage
AppManager$kill_all_apps(verbose = TRUE)
Arguments
verbose

(logical) Should messages be printed to the console?

Returns

Nothing returned


Method list_ports()

List ports used by registered apps

Usage
AppManager$list_ports()
Returns

Character vector with 0 or more elements


Method clone()

The objects of this class are cloneable with this method.

Usage
AppManager$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Not run: 
# Make a stub
manager <- AppManager$new()
manager

# Create background shiny apps
app <- system.file("apps/sever-info-app.R", package = "shinybg")
app1 <- runBackgroundApp(appFile = app, port = 3001)
app2 <- runBackgroundApp(appFile = app, port = 3002)

# Register the apps
manager$register_app(port = 3001, app = app1)
manager$register_app(port = 3002, app = app2)

# List all managed apps
manager
manager$list_ports()

# Retrieve app by port
manager$retrieve_app(port = "3001")

# Kill all apps
manager$kill_all_apps()

## End(Not run)

TileDB-Inc/shinybg documentation built on March 10, 2023, 3:14 p.m.