bwlewis / doRedis

R/foreach Redis backend for parallel computing
71 stars 26 forks source link

Management of redis connection #6

Open wush978 opened 11 years ago

wush978 commented 11 years ago

Hi,

I notice that after entering redisWorker and registerDoRedis, there is a redisConnect. However, before there is a redisClose before leaving redisWorker, but no redisClose before redisConnect.

Since rredis manages connection globally, I suggest to open an API to control whether managing the connection by redisWorker and redisDoRedis or not.

That is to say, if these function call redisConnect at the beginning, then it should call redisClose before leaving. Also, the user should have an option to control whether the redisConnect is called or not.

bwlewis commented 10 years ago

I'm not sure that it matters. It's safe to call redisConnect multiple times. It sems like this change would just introduce an unneccesary complciation? Am I misinterpreting your idea?