Skip to content
Browse files

Doc, better interrupt comm error handling

  • Loading branch information...
1 parent 64865ee commit f54fc25ae9e7d7ad71aecf2761582e6eea74c0de B. W. Lewis committed Oct 21, 2011
Showing with 41 additions and 82 deletions.
  1. +2 −2 DESCRIPTION
  2. +5 −4 NEWS
  3. +11 −3 inst/doc/rredis.Rnw
  4. BIN inst/doc/rredis.pdf
  5. +0 −54 man/redisGetContext.Rd
  6. +23 −19 man/redisSetContext.Rd
View
4 DESCRIPTION
@@ -2,10 +2,10 @@ Package: rredis
Type: Package
Title: Redis client for R
Version: 1.6.3
-Date: 2011-05-21
+Date: 2011-10-21
Author: B. W. Lewis
Maintainer: B. W. Lewis <blewis@illposed.net>
-Description: The 'redis' package provides a simple R client for the Redis persistent key-value database available from http://code.google.com/p/redis/.
+Description: The 'redis' package provides a simple R client for the Redis persistent key-value database available from http://redis.io.
License: Apache License 2.0
LazyLoad: yes
Packaged: 2010-07-11 16:25:37 UTC; blewis
View
9 NEWS
@@ -1,12 +1,13 @@
-Significant changes in version 1.6:
-- Transactions are supported.
-- Pub/sub is supported.
-- Better support for raw value types across the board.
1.6.3:
- Support for new redisInfo format
- Improved interrupt handling during communication
- Minor man page fixes
+Significant changes in version 1.6:
+- Transactions are supported.
+- Pub/sub is supported.
+- Better support for raw value types across the board.
+
Significant changes in version 1.4:
- Many bugs were fixed in the sorted sets (redisZ*) functions.
- New unit tests for sorted set functions were added.
View
14 inst/doc/rredis.Rnw
@@ -137,14 +137,16 @@ Scala, and more...
\subsection{Obtaining and Installing the Redis server}\label{install}
-Redis is an open-source project available from
-\htmladdnormallink{http://code.google.com/p/redis}{http://code.google.com/p/redis}, with source code available from Github at
+Redis is an open-source project available from
+\htmladdnormallink{http://redis.io}{http://redis.io}, with source code
+available from Github at
\htmladdnormallink{http://github.com/antirez/redis}{http://github.com/antirez/redis}.
Redis is also available as an installable package for most modern GNU/Linux
operating systems.
The Redis server is completely configured by the file
-\verb+redis.conf+. In order to run the Redis server as a background process,
+\verb+redis.conf+.
+In order to run the Redis server as a background process,
edit this file and change the line:
\noindent \verb+daemonize no+
@@ -153,6 +155,12 @@ edit this file and change the line:
\noindent \verb+daemonize yes+
+Most default Redis configuration files are set to disconnect connected
+clients after an inactivity time out interval. It's possible to disable
+that behavior in the \verb_redis.conf_ file with:
+
+\noindent \verb+timeout 0+
+
\noindent You may wish to peruse the rest of the configuration file and
experiment with the other server settings as well. Finally, start up the
Redis server with
View
BIN inst/doc/rredis.pdf
Binary file not shown.
View
54 man/redisGetContext.Rd
@@ -1,54 +0,0 @@
-\name{redisGetContext}
-\alias{redisGetContext}
-\title{redisGetContext}
-\description{Return the current active Redis connection environment.}
-\usage{
-redisGetContext()
-}
-\details{
-The rredis package stores everything associated with a connection to
-a Redis server in an environment. The \code{redisGetContext} and
-\code{redisSetContext} functions help manage simultaneous
-connection to multiple Redis servers.
-
-The \code{redisGetContext} function returns an environment representing
-the current active Redis connection. If there is no current active Redis
-connection, an environment is still returned, but without connection
-information.
-
-The \code{redisSetContext} function can initialize a new Redis connection
-environment or replace the current active environment with one previously
-referenced by \code{redisGetContext}. Any number of simultaneous connections
-to multiple Redis servers may be managed in this manner.
-}
-\value{
-An environment is returned. If a connection to a Redis server is active,
-the environment contains all the state associated with the active connection.
-}
-\author{
-B. W. Lewis
-}
-\seealso{
-\code{\link{redisSetContext}}
-}
-\examples{
-\dontrun{
-# Open a connection to a Redis server on HOST_1 and store its context:
-redisConnect(host='HOST_1')
-HOST_1 <- redisGetContext()
-
-# Initiate a new Redis context:
-redisSetContext()
-redisConnect(host='HOST_2')
-HOST_2 <- redisGetContext()
-
-# We may now switch back and forth between the two active connections:
-redisSetContext(HOST_1)
-redisKeys()
-redisSetContext(HOST_2)
-redisKeys()
-redisClose()
-redisSetContext(HOST_1)
-redisClose()
-}
-}
View
42 man/redisSetContext.Rd
@@ -1,17 +1,21 @@
\name{redisSetContext}
\alias{redisSetContext}
+\alias{redisGetContext}
\title{redisSetContext}
-\description{Set the current active Redis connection environment.}
+\description{Get or set the current active Redis connection environment.}
\usage{
-redisSetContext( e = new.env())
+redisSetContext( e = NULL)
+redisGetContext()
}
\arguments{
\item{e}{
- An environment representing the new context, defaults to a new context environment.
+ An environment representing the new Redis server connection context
+returned by \code{rediscConnect(returnRef=TRUE)}. The default value of NULL
+sets the context to the most recently established connection.
}
}
\details{
-The rredis package stores everything associated with a connection to
+The rredis package stores information associated with a connection to
a Redis server in an environment. The \code{redisSetContext} and
\code{redisSetContext} functions help manage simultaneous
connection to multiple Redis servers.
@@ -21,10 +25,9 @@ the current active Redis connection. If there is no current active Redis
connection, an environment is still returned, but without connection
information.
-The \code{redisSetContext} function can initialize a new Redis connection
-environment or replace the current active environment with one previously
-referenced by \code{redisSetContext}. Any number of simultaneous connections
-to multiple Redis servers may be managed in this manner.
+The \code{redisSetContext} function replaces the current active environment.
+Any number of simultaneous connections to multiple Redis servers may be managed
+in this manner.
}
\value{
NULL is invisibly returned.
@@ -34,25 +37,26 @@ B. W. Lewis
}
\seealso{
\code{\link{redisGetContext}}
+\code{\link{redisConnect}}
}
\examples{
\dontrun{
-# Open a connection to a Redis server on HOST_1 and store its context:
-redisConnect(host='HOST_1')
-HOST_1 <- redisGetContext()
+# Open a connection to a Redis server on HOST1 and store its context:
+HOST1 <- redisConnect(host='HOST1', returnRef=TRUE)
+print(redisInfo())
# Initiate a new Redis context:
-redisSetContext()
-redisConnect(host='HOST_2')
-HOST_2 <- redisGetContext()
+HOST2 <- redisConnect(host='HOST2', returnRef=TRUE)
+# The connection to HOST2 is now active:
+print(redisInfo())
# We may now switch back and forth between the two active connections:
-redisSetContext(HOST_1)
-redisKeys()
-redisSetContext(HOST_2)
-redisKeys()
+redisSetContext(HOST1)
+print(redisInfo())
+redisSetContext(HOST2)
+print(redisInfo())
redisClose()
-redisSetContext(HOST_1)
+redisSetContext(HOST1)
redisClose()
}
}

0 comments on commit f54fc25

Please sign in to comment.
Something went wrong with that request. Please try again.