Create a rlite connection. This function is designed to be used
in other packages, and not directly by end-users. However, it is
possible and safe to use. See the
for the user friendly interface.
Configuration parameters as generated by
This function creates a list of functions, appropriately bound to a pointer to a rlite connection. This is designed for package authors to use so without having to ever deal with the actual pointer itself (which cannot be directly manipulated from R anyway).
The returned list has elements, all of which are functions:
The configuration information
Attempt reconnection of a connection that has been closed, through serialisation/deserialiation or through loss of internet connection.
Run a Redis command. The format of this command will be documented elsewhere.
Run a pipeline of Redis commands.
Subscribe to a
channel or pattern specifying channels. Here,
be a character vector,
pattern a logical indicating if
channel should be interpreted as a pattern,
is a function to apply to each recieved message, returning
TRUE when subscription should stop, and
envir is the
environment in which to evaluate
callback. See below.
The callback function must take a single argument; this will be
the recieved message with named elements
type (which will
channel (the name of the channel) and
value (the message contents). If
TRUE, then an additional element
pattern will be
present (see the Redis docs). The callback must return
FALSE; this indicates if the client should
continue quit (i.e.,
TRUE means return control to R,
FALSE means keep going).
subscribe function is blocking and returns
nothing, so all data collection needs to happen as a side-effect
of the callback function.
There is currently no way of interrupting the client while it is waiting for a message.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.