R/rscontract_close.R

Defines functions rscontract_close

Documented in rscontract_close

#' Close a connection
#'
#' @param host Host name of the connection. Optional, defaults to empty
#' @param type Type of connection. Optional, defaults to empty
#' @examples
#' rscontract_open(rscontract_spec())
#' rscontract_close("spec_host", "spec_type")
#'
#' @return
#'
#' Returns a NULL object. If using the RStudio IDE, it will attempt to close the
#' connection identified by the `host` and `type` arguments
#'
#' @export
rscontract_close <- function(host = "", type = "") {
  observer <- getOption("connectionObserver")
  if (is.null(observer)) {
    return(invisible(NULL))
  }
  observer$connectionClosed(host = host, type = type)
}

Try the rscontract package in your browser

Any scripts or data that you put into this service are public.

rscontract documentation built on Dec. 16, 2020, 1:07 a.m.