Reconnections to Redis should be transparent to the user of redis-node-client. The user can just call command methods (e.g. lpush) even when not connected to Redis. The commands will be submitted to Redis when a connection to Redis is established. For commands that were submitted and the connection to Redis lost before receiving a reply, the reply will never come, and we have no knowledge of which submitted commands were processed by Redis. In this case, submitted commands will have their callbacks called with an err of an Error object whose .message is "IO Error" and whose .originalCommand is an Array containing the original command at index 0 and arguments thereafter. It is up to the caller to attempt to retry the call but the original callback is removed as the reply will never come for that submitted command. The user should be notified when a connection cannot be established (or a reconnection reestablished). If a connection to Redis fails and cannot be reestablished, the client emits noconnection. No reconnections will be attempted if the first connection attempt fails. The user should be notified when an attempt is made to reconnect to Redis after the initial or subsequent established connection is lost. The client emits reconnecting upon a reconnection attempt, and reconnected if the connection was reestablished. The user should be notified when a connection is established. The client emits a connected event when first connected, and reconnected when a connection is later reestablished automatically.
… 'connected', 'reconnecting', and 'noconnection' now; (thanks to pilif for motivating me to fix these)
- updated unit tests to use 'assert' module instead of 'mjsunit' - unit tests can now be run independently of each other as each configures the state needed for its tests - unit tests take into account that lpush/rpush return the length of the list - unit tests report the context of an error - updated TODO with upcoming work - updated README with more high level info
Solely (sans "SORT") uses the Redis mult-bulk request format which will soon be all that is supported by Redis. Supports Node.js v 0.1.33 which is the final release before the 'net2' branch was merged. Currently, Node.js HEAD is too buggy for me to code against. It will stabilize soon.
- Better reply parsing and error handling (nod to sma et al.) - Reworked tests - Added tests for reply parsing - Added roadmap for upcoming work