Annotation Type RAsync


@Inherited @Retention(RUNTIME) @Target({METHOD,CONSTRUCTOR}) public @interface RAsync
Methods marked by this annotation will be included in the R library api. Both static and non-static methods are supported. An async method may take a long time to execute and so is delegated to a java thread and returns an RFuture which will contain the asynchronously executed code. examples field is used to populate .Rd files
Version:
$Id: $Id
Author:
terminological
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Populate R examples.
    boolean
    Marks the output of this function as persistent.
    boolean
    Should the method be synchronised on the enclosing object? In general the responsibility of writing thread safe code is the developers.
    Populate R testthat tests.
  • Element Details

    • examples

      String[] examples
      Populate R examples. For non static methods this will be combined with @RClass(exampleSetup) annotation to construct a complete example. For static methods (and constructors) the examples will be run as is. Use try({}) in examples you are not sure about or are developing. Please use single quotes only in R expressions (don't try escaping double quotes)
      Returns:
      A list of R commands that will be executed as an example of this function.
      Default:
      {}
    • tests

      String[] tests
      Populate R testthat tests. For non static methods this will be combined with @RClass(testSetup) annotation to construct a complete test. For static methods (and constructors) the examples will be run as is. Use try({}) in examples you are not sure about or are developing. Please use single quotes only in R expressions (don't try escaping double quotes)
      Returns:
      A list of R commands that will be executed as a test of this function.
      Default:
      {}
    • synchronise

      boolean synchronise
      Should the method be synchronised on the enclosing object? In general the responsibility of writing thread safe code is the developers. A method annotated with @RAsync may be called repeatedly and
      Returns:
      Default:
      false
    • persist

      boolean persist
      Marks the output of this function as persistent. This means a reference to the result will be kept (in Java) after it has been retrieved in R, allowing it to be referred to later. Persistent objects, that have been processed can be cleared by a `RThreadMonitor.tidyUp()`. N.B. @RBlocking methods are never kept.
      Returns:
      Default:
      false