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

startGobbler(
  staging = tempfile(),
  registry = tempfile(),
  port = NULL,
  wait = 1,
  version = "0.3.7",
  overwrite = FALSE
)

stopGobbler()

Arguments

staging

String containing a path to a staging directory. Ignored if the service is already running.

registry

String containing a path to a registry. Ignored if the service is already running.

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 startGobbler, a list containing:

  • new, a logical scalar indicating whether a new service was set up.

  • staging, string containing the location of the staging directory.

  • registry, string containing the location of the registry.

  • port, integer containing the port.

  • url, string containing the URL of the REST API.

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

See also

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

Examples

startGobbler()
#> $new
#> [1] FALSE
#> 
#> $staging
#> [1] "/tmp/Rtmpk5zsYr/file2191962a99d"
#> 
#> $registry
#> [1] "/tmp/Rtmpk5zsYr/file21928641d8f"
#> 
#> $port
#> [1] 5114
#> 
#> $url
#> [1] "http://0.0.0.0:5114"
#> 
startGobbler() # repeated calls just re-use the same instance.
#> $new
#> [1] FALSE
#> 
#> $staging
#> [1] "/tmp/Rtmpk5zsYr/file2191962a99d"
#> 
#> $registry
#> [1] "/tmp/Rtmpk5zsYr/file21928641d8f"
#> 
#> $port
#> [1] 5114
#> 
#> $url
#> [1] "http://0.0.0.0:5114"
#> 

stopGobbler()
startGobbler() # reinitializes a new instance.
#> $new
#> [1] TRUE
#> 
#> $staging
#> [1] "/tmp/Rtmpk5zsYr/file21916756f11"
#> 
#> $registry
#> [1] "/tmp/Rtmpk5zsYr/file2197142a3a8"
#> 
#> $port
#> [1] 3484
#> 
#> $url
#> [1] "http://0.0.0.0:3484"
#>