RP_APISubscribeRT: RP_APISubscribeRT

View source: R/RP_SelfServiceAPI_EndPoints.R

RP_APISubscribeRTR Documentation

RP_APISubscribeRT

Description

Subscribes to real-time analytics.

Usage

RP_APISubscribeRT(APIHandler, datasetUUID, funPath)

Arguments

APIHandler

An API handler, created using RP_CreateAPIHandler.

datasetUUID

A string with the dataset identifier to subscribe.

funPath

The path to an R function to process the stream. Bear in mind the data will be passed from a curl call using a pipe. Something like: curl -s -H \"api-key:XXX\" \"https://feed.ravenpack.com/1.0/json/<datasetUUID>\" | R -f funPath As a function example: "f <- file("stdin") open(f) while(length(line <- readLines(f,n=1)) > 0) { write(line, stderr()) print(line) # do any other process }"

Value

A stream of JSON objects separated by '\n'

Author(s)

Jose A. Guerrero-Colon


RavenPack/r-api documentation built on July 30, 2022, 9:56 p.m.