Get information on database updates

Share:

Description

Get information on database updates

Usage

1
2
db_updates(cushion, feed = "longpoll", timeout = 60, heartbeat = TRUE,
  as = "list", ...)

Arguments

cushion

A Cushion object. Required.

feed

(character) One of longpoll (default), continuous, or eventsource. See Details.

timeout

(integer) Number of seconds until CouchDB closes the connection. Default: 60.

heartbeat

(logical) Whether CouchDB will send a newline character on timeout. Default: TRUE

as

(character) One of list (default) or json

...

Curl args passed on to one of the HTTP verbs (e.g,. GET, POST, PUT, etc.)

Details

This may not be very appropriate for use in R, but who knows, so here it is.

Also, continuous and eventsource don't seem to work in R, unless I'm missing something.

Options for the feed parmeter:

  • longpoll: Closes the connection after the first event.

  • continuous: Send a line of JSON per event. Keeps the socket open until timeout.

  • eventsource: Like, continuous, but sends the events in EventSource format.

Value

JSON as a character string or a list (determined by the as parameter)

Examples

1
2
3
4
5
6
7
8
## Not run: 
(x <- Cushion$new())

db_updates(x)
db_updates(x, feed="continuous")
db_updates(x, feed="eventsource")

## End(Not run)