Module: R::Async

Defined in:
lib/R_interface/r.rb

Overview

Async R function calls without blocking the caller. Requires a block; completion receives NewBridge::EvalResult. (+R.foo { ... }+ is reserved for dplyr-style scopes; use R::Async.foo(...) for async completion.)

Class Method Summary collapse

Class Method Details

.method_missing(symbol, *args, **kwargs, &block) ⇒ Object

Raises:

  • (ArgumentError)


110
111
112
113
114
115
116
# File 'lib/R_interface/r.rb', line 110

def self.method_missing(symbol, *args, **kwargs, &block)
  raise ArgumentError, 'R::Async method calls require a block' unless block

  timeout = kwargs.delete(:timeout)
  name = R::Support.convert_symbol2r(symbol)
  R::Support.exec_function_async(name, *args, timeout: timeout, **kwargs, &block)
end