CustomFunctionModule: Custom Function Module

Description Usage Format Class Constructor Public Private Static Class Methods

Description

Implementation of ModuleInterface for executing a user defined function. Uses future package for execution.

Usage

1

Format

An object of class R6ClassGenerator of length 25.

Class Constructor

new(name, fun)
  • name: Unique character string that identifies this module instance.

  • fun: function this module will execute. Must be a reference to the actual function.

Public

clearOutputCache()
  • Clears output cache stored in this instance so memory can be reclaimed.

  • Returns: NULL.

errorCheck(executionCheck = FALSE, ...)
  • Runs error checking on the internal state of this object for erroneous values.

  • executionCheck: when set to TRUE, runs additional checks to determine if ready for execution.

  • ...: not used by this component.

  • Returns: NULL, will raise a fatal error if an error is found.

getFuncObj()
  • Gets the base R function object that is called when a module's execution is started.

  • Returns: R function object.

getInputs()
  • Gets a named logical vector where the names are the possible inputs into a module and the values indicate if an input is required.

  • Returns: logical vector.

getName()
  • Gets the name of this function.

  • Returns: character string that is the name of this module.

getOutput()
  • Gets the output of the function executed by this module.

  • Returns: The output of the function if the execution has completed. NULL will be returned if the execution has not been started or is still in progress.

getSaveInfo()
  • Gets a named list of internal states of this object which can be used to save this object on disk.

  • Returns: a named list

hasCompleted()
  • Indicates if the execution of the associated function of this module is complete.

  • Returns: a boolean where TRUE indicates the execution is complete and FALSE indicates the execution is not complete or not started.

startExecution(args)
  • Starts the execution of the function associated with this module. This is non-blocking if using an asynchronous.

  • args: named list of arguments for function associated with this module

  • Returns: NULL

Private

fun
  • Stores associated function name.

futurePromise
  • Stores promise of future output of a function.

Static Class Methods

CustomFunctionModule-cash-initFromSaveData

UptakeOpenSource/updraft documentation built on Oct. 17, 2019, 3:31 p.m.