BackendRserve: Creates Rserve backend for processing HTTP requests

Description Super class Methods References

Description

Creates BackendRserve object which can start Application using Rserve backend.

Super class

RestRserve::Backend -> BackendRserve

Methods

Public methods

Inherited methods

Method new()

Creates BackendRserve object.

Usage
BackendRserve$new(..., jit_level = 0L, precompile = FALSE)
Arguments
...

Not used at the moment.

jit_level

changes R's byte compiler level to this value before app start.

precompile

try to use R's byte compiler to pre-compile


Method start()

Starts RestRserve application from current R session.

Usage
BackendRserve$start(app, http_port = 8080, ..., background = FALSE)
Arguments
app

Application object.

http_port

HTTP port for application. Negative values (such as -1) means not to expose plain http.

...

Key-value pairs of the Rserve configuration. If contains "http.port" then http_port will be silently replaced with its value.

background

Whether to try to launch in background process on UNIX.

Returns

ApplicationProcess object when background = TRUE.


Method set_request()

Parse request and set to it fields.

Usage
BackendRserve$set_request(
  request,
  path = "/",
  parameters_query = NULL,
  headers = NULL,
  body = NULL
)
Arguments
request

Request object.

path

Character with requested path. Always starts with /.

parameters_query

A named character vector with URL decoded query parameters.

headers

Request HTTP headers.

body

Request body. Can be NULL, raw vector or named character vector for the URL encoded form (like a parameters_query parameter).

Returns

request modified object.


Method convert_response()

Convert self object to Rserve compatible structure.

Usage
BackendRserve$convert_response(response)
Arguments
response

Response object.

Returns

List with the following structure:


Method clone()

The objects of this class are cloneable with this method.

Usage
BackendRserve$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

See http.c in Rserve


RestRserve documentation built on Jan. 13, 2021, 7:05 p.m.