scalaDisconnect: Temporarily Disconnect Scala by Closing Connections

View source: R/scalaDisconnect.R

scalaDisconnectR Documentation

Temporarily Disconnect Scala by Closing Connections

Description

This function temporarily disconnects a Scala bridge by closing its associated socket connections. The primary place where this function is used is at the end of examples of packages that depend on rscala (because, under some versions of R, "R CMD check --as-cran" does not permit connections to persist after an example ends).

Usage

scalaDisconnect(bridge = scalaFindBridge())

Arguments

bridge

A Scala bridge.

Examples


showConnections()
s <- scala()
showConnections()         # No additional connections yet.
s * "3+4"
showConnections()         # Now there are two additional connections.
scalaDisconnect()
showConnections()         # The new connections are gone.
s * "3+4"
showConnections()         # New connections are established as needed.
close(s)



rscala documentation built on Aug. 15, 2023, 9:07 a.m.