This sets up a single SewerRat service for the entire R session, is intended for examples and tests. Real SewerRat deployments should operate outside of R.

startSewerRat(
  db = tempfile(fileext = ".sqlite3"),
  port = NULL,
  wait = 1,
  version = "1.0.9",
  overwrite = FALSE
)

stopSewerRat()

Arguments

db

String containing a path to the SQLite database.

port

Integer specifying the port to use for hosting the service. If NULL, a free port is randomly selected.

wait

Integer specifying the number of seconds to wait for service initialization.

version

String containing the desired version of the Gobbler binary.

overwrite

Logical scalar indicating whether to redownload the Gobbler binary.

Value

For startSewerRat, a list indicating whether a new service was set up, along with the port number and URL to use in other SewerRat functions.

For stopSewerRat, any existing service is shut down, and NULL is invisibly returned.

See also

https://github.com/ArtifactDB/SewerRat, for source code and binaries to build and run a SewerRat service.

Examples

startSewerRat()
#> $new
#> [1] FALSE
#> 
#> $port
#> [1] 5114
#> 
#> $url
#> [1] "http://0.0.0.0:5114"
#> 
startSewerRat() # repeated calls just re-use the same instance.
#> $new
#> [1] FALSE
#> 
#> $port
#> [1] 5114
#> 
#> $url
#> [1] "http://0.0.0.0:5114"
#> 

stopSewerRat()
startSewerRat() # initialize a new instance.
#> $new
#> [1] TRUE
#> 
#> $port
#> [1] 3484
#> 
#> $url
#> [1] "http://0.0.0.0:3484"
#>