GithubHelp home page GithubHelp logo

Comments (6)

eddelbuettel avatar eddelbuettel commented on May 26, 2024

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.

bluaze avatar bluaze commented on May 26, 2024

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.

eddelbuettel avatar eddelbuettel commented on May 26, 2024

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.

russellpierce avatar russellpierce commented on May 26, 2024

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.

eddelbuettel avatar eddelbuettel commented on May 26, 2024

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.

eddelbuettel avatar eddelbuettel commented on May 26, 2024

Closing as stale.

from rcppredis.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.