A Rook app to be a JSON RPC server

Share:

Description

This app allows the browser to call back into R by specifying an object name, its method name and some parameters. The object then returns JSON to the browser. Only instances of subclasses of JsonRPCObject are allowed and for them only exported methods may be accessed.

Details

Unlike other gWidgetsWWW2 AJAX calls, the environment that these objects lives in is typically the global environment, rather than an environment that is created when a gWidgetsWWW2 page is. This allows one to share such objects across many pages. In the examples there is a page counter and a data set provider.

This is not subclassed, but rather the function call json_rpc_server should be made.

Methods

load(url = "JSON_RPC", port = 9000)

Load the server as Rook app.

read_rook_input(req)

Read rook.input, then convert from JSON

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.