Comments (6)
I suppose. Any idea how to implement that?
OTOH one can just get a new object in each worker:
R> library(RcppRedis)
R> library(parallel)
R> res <- mclapply(1:4, function(i) { nr <- new(Redis, "localhost"); length(nr$keys("*")); })
R> res
[[1]]
[1] 68
[[2]]
[1] 68
[[3]]
[1] 68
[[4]]
[1] 68
R>
from rcppredis.
Actually, I have no idea about how to do it. I just have read some article recommending not to manually manage connections, such as http://sorentwo.com/2015/08/25/managing-redis-reconnections-from-ruby.html
from rcppredis.
I think for now the simplest approach is to re-create a connection as I did there. I leave this open as unfixed.
from rcppredis.
I'm late to the party, but FWIW in my own code I've handled this by wrapping the Redis connection up inside an R6 object that is PID aware. When the PID changes, I rebuild the connection. I'd briefly considered committing something along those lines here a while back, but it seems as though RcppRedis is meant to stay pretty purely Rcpp without a bunch of extra R cruft.
from rcppredis.
Ah, well, we could. If there is a use case, and ideally a test case.
I don't seem to need it. Many of my clients to Redis are shiny apps which seem to stay connected "forever".
But we can discuss.
from rcppredis.
Closing as stale.
from rcppredis.
Related Issues (18)
- cannot install rcppredis HOT 4
- Status Statement Incomplete HOT 1
- Password is echoed HOT 6
- Segfault during tools:::.test_load_package on Ubuntu 15.10 HOT 1
- API is incomplete HOT 4
- RcppRedis is version unaware HOT 4
- RcppRedis could leak connections HOT 2
- R crash on Redis server loss HOT 21
- Propogate errors from exec / execv (if possible) HOT 1
- On constructing connection timeout values less than 1 can cause freeze HOT 1
- MsgPack support
- rcppredis issues when deploying a Shinyapp HOT 2
- plan to add additional hash commands (HDEL, HLEN, HKEYS, and HGETALL)
- Connection error HOT 1
- Replace boost::lexical_cast with std::to_string
- Should listen be an internal method? HOT 5
- Upgrade embedded hiredis to 1.0.0 ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcppredis.