1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

380 Commits

Author SHA1 Message Date
David Trejo
3b645c893d index.js: fix missing .EXEC alias 2012-04-27 13:35:14 -04:00
Brian Noguchi
64a0e68927 Add fix for last test (re-establish pub_sub_mode = true) 2012-03-12 23:03:46 -07:00
David Trejo
234ae6be9a Emit Error objects not strings 2012-03-05 17:29:54 -05:00
Matt Ranney
3a7c6388de Fix for [GH-93] - restore subscriptions, monitor, db, and auth on reconnect.
Also fixes bug with re-selecting db when auth is required.
Still needs a test for pub/sub reconnect and monitor reconnect.
2011-11-16 17:27:26 -10:00
Matt Ranney
faca4a8dc9 Bounds checking on Array expansion magic. 2011-11-16 12:10:19 -10:00
Matt Ranney
b9734d13eb Add socket_nodelay option to control Nagle. Fixes [GH-33] 2011-11-16 11:12:26 -10:00
Zachary Scott
c83c285213 remove double 'util' and 'Queue' from requires
ex: require('./lib/util').util;
2011-11-16 10:37:38 -10:00
Matt Ranney
edf46776a1 Merge remote-tracking branch 'dayananda/master'
Conflicts:
	index.js
2011-11-15 19:40:24 -10:00
Matt Ranney
69092a3f26 [GH-67] - hgetall now returns null instead of {} on empty reply 2011-11-15 15:21:49 -10:00
Matt Ranney
e39e8421bc Fix regression in reconnect logic.
Very much need automated tests for reconnection and queue logic.
2011-11-15 10:48:45 -10:00
Matt Ranney
29c408cbf1 Update TODO comment for retry thresholds. 2011-11-14 20:23:11 -10:00
Matt Ranney
dfd4c51b79 Merge pull request #136 from bobrik/callback-fixes
added ability to pass undefined instead of callback
2011-11-14 22:15:36 -08:00
Matt Ranney
6232d35993 Subscribe commands take optional callback. Fixes [GH-140]. 2011-11-13 21:01:15 -10:00
Matt Ranney
6a44331acd Fix this/self reference on db re-select. 2011-11-13 20:19:34 -10:00
Matt Ranney
dfcfaf3dc5 Fix style. 2011-11-13 20:12:22 -10:00
Matt Ranney
82cc930bc7 Merge pull request #142 from oxys/master
After a connection error, selected db, if it was set, is not restored
2011-11-13 21:57:32 -08:00
Matt Ranney
b633587b49 Fix flush+error bug on server disconnect.
Also assign a client ID to each client because stream.fd isn't available in node 0.6.
2011-11-13 18:11:28 -10:00
Matt Ranney
c74657cdfa Improved reconnect logic. Initial version of reconnect thresholds. 2011-11-10 13:09:39 -10:00
Owen Smith
54cf583dc3 Support new option 'max_attempts' to specify a total number of connection retries 2011-11-10 13:05:46 -10:00
Owen Smith
025c2e938e Support new option 'connect_timeout' to stop connection retries after the number of ms specified 2011-11-10 13:03:51 -10:00
Dayananda Nanjundappa
a6670edb9a Support for retrieving data as Buffer on a per command basis
This is achieved by introducing a new option to the createClient method called bufferedInput.
If bufferedInput is set to true, then the returned data will be a Buffer if the command argument passed is a buffer

E.g.
    var redis = require("redis"),
    client = redis.createClient(<port>, <host>, {buffered_input: true});

    client.set("foo_rand000000000000", "OK");

    // The below get request will return a utf8 string
    client.get("foo_rand000000000000", function (err, reply) {
        console.log(reply.toString()); // Will print `OK`
    });

    // The below get request will return a Buffer as the key is specified as a Buffer
    client.get(new Buffer("foo_rand000000000000"), function (err, reply) {
        console.log(reply.toString()); // Will print `<Buffer 4f 4b>`
    });
    client.end();
2011-11-03 16:32:47 +05:30
Jean-Hugues Pinson
074555396b override select method to store selected db in client instance and restore selected db on connect 2011-10-20 10:01:47 +02:00
Felix Geisendörfer
61ddce87fa Fix bad reference to 'this' 2011-10-19 14:48:01 +02:00
Ian Babrou
f30ecbe561 added ability to pass undefined instead of callback 2011-10-02 11:42:23 +04:00
Matt Ranney
3e95c55a03 Fix for [GH-127]
Re-initialize the reply parser for every new connection.  If a connection is terminated,
the parser could be left in a bad state.  After the auto-reconnect magic kicks in, it
tries to reuse the old parser, which will not work.

This change is visible to client programs if you depend on client.reply_parser.name being
set immediately.  It will now only be set after a connection is established.

Thanks to @jhurliman for reporting and @pietern for the fix suggestion.
2011-08-11 11:00:02 -07:00
Matt Ranney
688b838be7 Revert "Fixes the case where if the quit() method is called, the closing variable checks are not honoured."
This reverts commit 263965ae44.

Conflicts:

	index.js
2011-07-30 17:29:39 -07:00
Matt Ranney
50d9f8d45e Fix and test for [GH-123]
Passing an Array as as the last argument should expand as users
expect.  The old behavior was to coerce the arguments into Strings,
which did surprising things with Arrays.
2011-07-30 17:24:10 -07:00
Mark Dawson
263965ae44 Fixes the case where if the quit() method is called, the closing variable checks are not honoured. 2011-07-18 22:08:43 -07:00
Matt Ranney
3cc297ada4 Contributed changes:
*  Support SlowBuffers (Umair Siddique)
*  Add Multi to exports (Louis-Philippe Perron)
*  Fix for drain event calculation (Vladimir Dronnikov)

Thanks!
2011-07-06 09:49:40 -05:00
Matt Ranney
49300363e4 Merge pull request #118 from dvv/master
fix for drain event
2011-07-06 07:28:37 -07:00
Matt Ranney
256ce6b736 Merge pull request #119 from umairsiddique/master
SlowBuffer support
2011-07-06 07:18:07 -07:00
Louis-Philippe Perron
abc647ccb5 exports Multi as commodity 2011-07-04 15:18:03 -04:00
Umair Siddique
769748f473 Now it works with SlowBuffer too. 2011-07-04 06:13:29 +05:00
Vladimir Dronnikov
9a4e51ee40 fix for buffered_writes -- now drain event works 2011-07-01 03:46:50 -04:00
Matt Ranney
891529c06a Fix bug with optional callbacks for hmset. 2011-06-30 16:13:57 -06:00
Matt Ranney
fa272cf763 authentication retry while server is loading db (danmaz74) [GH-101] 2011-06-30 14:29:15 -06:00
Matt Ranney
f9e17556d2 Performance improvements and backpressure controls.
Simply and speed up command argument processing logic.
Commands now return the true/false value from the underlying socket write(s).
Implement command_queue high water and low water for more better control of queueing.
2011-06-30 14:12:35 -06:00
Matt Ranney
13914295a6 Merge pull request #101 from danmaz74/master
Fix bug with authentication and LOADING error response.
2011-06-30 11:19:20 -07:00
Matt Ranney
707c9ab3df Add static list of commands to those downloaded from redis.io. 2011-06-28 22:48:30 -07:00
Matt Ranney
4b988bdb60 Bug fix for monitor mode. (forddg)
Also some whitespace fix for JSHint.
2011-06-12 14:35:21 -10:00
Dave Hoover
e210755b52 Developing the 'somehow' in 'This list [of commands] needs to be updated, and perhaps auto-updated somehow' 2011-06-02 21:12:13 -05:00
unknown
719d4f74cc Fixed a bug when the client tries to authenticate to the redis server and the server is still loading the database: Now the client tries to authenticate again every 2 seconds until actually authenticated. "connect" is only emitted after authentication if authentication is required. 2011-05-08 19:57:27 +02:00
Matt Ranney
f10ff9e916 Lots of bugs fixed.
*  connection error did not properly trigger reconnection logic [GH-85]
*  client.hmget(key, [val1, val2]) was not expanding properly [GH-66]
*  client.quit() while in pub/sub mode would throw an error [GH-87]
*  client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92]
2011-04-21 16:48:14 -10:00
Matt Ranney
f624fa6234 Added DISCARD
I originally didn't think DISCARD would do anything here because of the clever MULTI interface, but somebody
pointed out to me that DISCARD can be used to flush the WATCH set.
2011-04-07 08:58:01 -07:00
Matt Ranney
2b8b2cbd7f Added HVALS command 2011-04-06 09:50:29 -07:00
Andy Ray
bbd48a6fac fix for issue of saving document with buffer AND array on it 2011-03-14 16:02:09 -10:00
Matt Ranney
2fcc947f11 Add MONITOR command and special monitor command reply parsing. 2011-03-14 15:50:47 -10:00
Matt Ranney
1a14e24faa Add magical auth command.
Authentication is now remembered by the client and will be automatically sent to the server
on every connection, including any reconnections.
2011-02-27 23:10:44 -10:00
Matt Ranney
29e09c1c16 Fix bug in ready check with return_buffers set to true.
Thanks to Dean Mao and Austin Chau.
2011-02-22 21:10:50 -10:00
Matt Ranney
ee93d1b91b Add probe for server readiness.
When a Redis server starts up, it might take a while to load the dataset into memory.
During this time, the server will accept connections, but will return errors for all non-INFO
commands.  Now node_redis will send an INFO command whenever it connects to a server.
If the info command indicates that the server is not ready, the client will keep trying until
the server is ready.  Once it is ready, the client will emit a "ready" event as well as the
"connect" event.  The client will queue up all commands sent before the server is ready, just
like it did before.  When the server is ready, all offline/non-ready commands will be replayed.
This should be backward compatible with previous versions.

To disable this ready check behavior, set `options.no_ready_check` when creating the client.

As a side effect of this change, the key/val params from the info command are available as
`client.server_options`.  Further, the version string is decomposed into individual elements
in `client.server_options.versions`.
2011-02-16 15:46:27 -10:00