miyagawa / AnyEvent-Redis

Asynchronous Redis client
http://search.cpan.org/dist/AnyEvent-Redis
41 stars 16 forks source link

persistent Redis database index selection over (re)connects #27

Open jozef opened 5 years ago

jozef commented 5 years ago

Hello,

attached is patch that adds dbindex to constructor so that the (re)connect method switches to that database index using Redis select command. Without it anyone using other database indexes other then zero may start to write to index 0 after unexpected reconnect.

In addition select command is extended to update dbindex value after successful select index command execution - run-time database index switching.

Best regards Jozef