startRookAnalysisPageServer: Start a new Rook AnalysisPage server

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Start a new Rook AnalysisPage server. This is a convenience wrapper around new.rook.analysis.page.app which builds the Rook App and then also makes a Rook server (Rhttpd object) which just contains the one App. It then starts the server in a fork and returns the PID of the child process.

Usage

1
2
3
startRookAnalysisPageServer(reg, tmpdir = tempdir(), ...,
  app = new.rook.analysis.page.app(reg, tmpdir = tmpdir, app.name = app.name,
  ...), app.name = "RAPS", port = 5000)

Arguments

reg

AnalysisPageRegistry from which to build application. Passed through to new.rook.analysis.page.app.

tmpdir

Directory for temporary files. Passed through to new.rook.analysis.page.app. Default: tempdir().

...

Passed through to new.rook.analysis.page.app.

app

Rook App to put into the server. Default: new.rook.analysis.page.app(reg, tmpdir = tmpdir, ...). Normally you would omit this argument.

app.name

Name for App within server, default "RAPS" (for Rook AnalysisPageServer). This will determine the second part of the URL, for example "/custom/RAPS".

port

Port on which to start listening.

Value

list with two componenets:

$url

URL to base of application

$pid

Process ID of server

Note

This function used to be called start.rook.analysis.page.server but that led to an R CMD check warning about S3 method inconsistency.

Author(s)

Brad Friedman

See Also

new.rook.analysis.page.app, kill.process

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
  registry <- AnalysisPageServer:::trig.registry()
  server <- startRookAnalysisPageServer(registry, port = 5102)

  ## do some stuff
  ## For example
  landing.page.url <- rook.analysis.page.server.landing.page(server)
  ## now go to your web browser and open landing.page.url

  ## Or maybe something in this R process. See what the pages are
  pages.url <- file.path(server$url, "R", "pages")
  pages <- fromJSON(readLines(pages.url, warn = FALSE))
  sapply(pages, "[[", "name")

  ## Kill the server
  kill.process(server)

## End(Not run)
message("See vignette ExamplesServers.html")

apomatix/AnalysisPageServer documentation built on May 26, 2019, 11:36 a.m.