1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

69 Commits

Author SHA1 Message Date
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
90aa21936c Update TODO comment 2011-11-14 20:14:49 -10:00
Matt Ranney
8d0457f2c3 Add test for monitor command. 2011-11-13 21:18:12 -10:00
Matt Ranney
719c606b78 Fix test for optional subscribe callback. 2011-11-13 21:03:32 -10:00
Matt Ranney
6232d35993 Subscribe commands take optional callback. Fixes [GH-140]. 2011-11-13 21:01:15 -10:00
Matt Ranney
c74657cdfa Improved reconnect logic. Initial version of reconnect thresholds. 2011-11-10 13:09:39 -10:00
bobrik
0c1c8cab83 added test for optional callbacks 2011-10-15 17:07:40 +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
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
Matt Ranney
891529c06a Fix bug with optional callbacks for hmset. 2011-06-30 16:13:57 -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
6e5112d664 Add support and tests for Redis scripting through EXEC command.
Bug fix for monitor mode.  (forddg)

Auto update of new commands from redis.io (Dave Hoover)
2011-06-29 00:45:43 -07: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
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
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
Matt Ranney
ccce845cc2 Some bug fixes:
* An important bug fix in reconnection logic.  Previously, reply callbacks would be invoked twice after
  a reconnect.
* Changed error callback argument to be an actual Error object.

New feature:

* Add friendly syntax for HMSET using an object.
2010-12-29 17:48:40 -08:00
Matt Ranney
36c40ee03d JavaScript parser passes all tests when returning strings.
JS is still way too slow for large mb replies.  Hiredis is fast for strings of large  replies,
but slow for buffers.
2010-12-07 00:23:31 -08:00
Matt Ranney
b907364573 Support for multiple reply parsers including hiredis.
Several parsing bugs fixed in JavaScript.
Some new config options that need to be better documented.
2010-12-06 09:11:16 -08:00
Pieter Noordhuis
7b4ca228d6 Fix incorrect test 2010-11-30 23:00:32 +01:00
Pieter Noordhuis
8c158eb75f Merge branch 'master' into hiredis-merge 2010-11-30 22:40:36 +01:00
Matt Ranney
f30e08235f Explicitly check for empty Array instead of comparing to [] 2010-11-30 13:37:53 -08:00
Pieter Noordhuis
88711fe4fe Move requiring util to a separate file 2010-11-30 22:19:24 +01:00
Matt Ranney
12d2aebb70 Send empty Array for 0 length mb replies instead of null. 2010-11-30 13:05:07 -08:00
Matt Ranney
79511b4499 Fix parser bug after failed EXEC. 2010-11-30 11:47:52 -08:00
Matt Ranney
05e9699817 Fix for null MULTI response when WATCH condition fails. 2010-11-10 10:36:26 -08:00
Paul Carey
5bddbe3d9a Partial fix for null multi bulk response. 2010-11-10 10:04:47 -08:00
Matt Ranney
f91626d110 Send friendlier error event on stream errors. 2010-11-03 12:43:18 -07:00
Matt Ranney
86b2c22c80 Use db 15 for testing. Adapt many fine tests from fictorial's client. 2010-10-30 01:38:47 -07:00
Matt Ranney
ee976bb82c Add test for BLPOP, tighten up MULTI tests. 2010-10-21 18:14:44 -07:00
Aivo Paas
1cfbdea49a Minor fixes in tests
Moved a last() call to the end of a test
Fixed typo and added error message when client emits error
2010-10-02 22:06:16 +03:00
Aivo Paas
3495b60047 Fixed .multi() to convert HGETALL result to an object 2010-10-02 22:00:57 +03:00
Orion Henry
dcbb87dff7 fix bug not allowing you to quit while in subscribe mode - added test 2010-09-27 17:11:12 -07:00
Orion Henry
01068565d9 adding a test for utf8 strings 2010-09-27 16:34:54 -07:00
Matt Ranney
a21607100b Add test for multi with array args. 2010-09-24 18:45:39 -07:00
Matt Ranney
d7b14b335a More tests for different MULTI syntax. 2010-09-24 13:16:30 -07:00
Matt Ranney
29f10cd593 Merge remote branch 'tj/features/multi'
Conflicts:
	test.js
2010-09-24 10:51:21 -07:00
Matt Ranney
c1225b9b86 More tests for MULTI and nested multi-bulk replies. 2010-09-23 12:21:24 -07:00
Tj Holowaychuk
7795d68351 Extended multi test to include multibulk 2010-09-22 20:12:37 -07:00
Tj Holowaychuk
91ebe64dae Implemented alternate MULTI syntax
Usage:

  client
    .multi
    .set(foo, bar)
    .set(counter, 1)
    .incr(counter)
    .exec(function(err, replies){});
2010-09-22 18:38:55 -07:00
Matt Ranney
bbbc4abd3b Update MULTI test for nested multi-bulk. 2010-09-22 17:34:45 -07:00
Matt Ranney
58e620058f Add test for BLPOP. 2010-09-22 10:33:53 -07:00
rick
0b51924aa7 ensure client emits connect and end events 2010-09-20 12:29:35 -07:00
Matt Ranney
6359a02208 Add QUIT command for orderly shutdown. 2010-09-20 11:56:30 -07:00
Tj Holowaychuk
8cd56f5987 Fixed HGETALL_NULL assertions 2010-09-20 07:34:23 -07:00
Tj Holowaychuk
a93020c555 Fixed null HGETALL bug causing exception 2010-09-20 07:32:45 -07:00
Matt Ranney
200ced827a Add test for pub/sub. 2010-09-19 23:47:39 -07:00
Matt Ranney
42c752f759 Add test for HINCRBY 2010-09-18 21:27:09 -07:00
Matt Ranney
09f1564b7c Add test for HMGET 2010-09-18 20:24:06 -07:00