run {acumos}R Documentation

Run-time tools for Acumos


The following functions are not exported and not intended to be used by users, but are useful for Acumos developers, testing and used by the platform itself.


run(where = getwd(), file = "", runtime = "runtime.json",
    init.only = FALSE)
data2msg(data, output)
msg2data(msg, input)
send.msg(url, payload, response=FALSE)



directory in which the component will be run


path to the model component file (as created by compose()) or a directory containing the unpacked content of the component.


raw vector, message to send - typically constructed by data2msg


either path to the runtime JSON file or a structure corresponding to the parsed payload of the file


logical, if TRUE then the runtime is setup but the actual server/generator is not executed.


data to wrap into a message - it is expected to be a list (hence a data frame qualifies)


name of the proto message type to use


raw vector containing the message


name of the proto message type to use


string, URL to send the message to


logical, if TRUE then the HTTP response object is returned, otherwise only a logical denoting success or failure.


run loads and runs the component by providing a service endpoint on localhost and post specified by the input_port property in the runtime object.

The component file is expected to be created by the compose function. runtime defines the run-time properties such as input port and outputs.

data2msg performs the conversion of native types to the binary message for communication with other Acumos components.

msg2data converts a Acumos message to data according to the provided schema.


The return value of run is undefined since it is executed for its side-effect of providing the service and may never return.

data2msg returns a raw vector constituting the message

msg2data returns the data represented by the message

send.msg returns TRUE on success, FALSE otherwise unless response is TRUE in which case the full response object is returned.


The .proto file containing the schema definitions must be loaded before data2msg() and msg2data() are used, e.g., by the virtue of being inside the run() function or explicitly using RProtoBuf::readProtoFiles(proto).

The run() function can be used only once in a session, because protobuf definitions are global and cannot be overridden without a conflict.

The internal Acumos communication protocol is subject to change and all of the above functions are hidden.

If the runtime list contains an entry data_response=TRUE then the component also returns the result in the response body (in addition to any output URL specifications). In all other cases the response is always "OK" on success and error string on error.


Simon Urbanek

See Also


[Package acumos version 0.4-4 Index]