py_main_thread_func: Create a Python function that will always be called on the...

Description Usage Arguments Value

View source: R/thread.R

Description

This function is helpful when you need to provide a callback to a Python library which may invoke the callback on a background thread. As R functions must run on the main thread, wrapping the R function with py_main_thread_func() will ensure that R code is only executed on the main thread.

Usage

1

Arguments

f

An R function with artibrary arguments

Value

A Python function that delegates to the passed R function, which is guaranteed to always be called on the main thread.


merlingrace/reticulate1 documentation built on Nov. 4, 2019, 6:25 p.m.