Skip to content

Commit 2e3ec4a

Browse files
author
Ruben Bridgewater
committed
Remove hiredis support
1 parent 1184bd6 commit 2e3ec4a

File tree

6 files changed

+371
-442
lines changed

6 files changed

+371
-442
lines changed

README.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# redis-parser
66

7-
A high performance redis parser solution built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/luin/ioredis).
7+
A high performance javascript redis parser built for [node_redis](https://github.com/NodeRedis/node_redis) and [ioredis](https://github.com/luin/ioredis).
88

99
Generally all [RESP](http://redis.io/topics/protocol) data will be properly parsed by the parser.
1010

@@ -30,8 +30,7 @@ new Parser(options);
3030
* `returnError`: *function*; mandatory
3131
* `returnFatalError`: *function*; optional, defaults to the returnError function
3232
* `returnBuffers`: *boolean*; optional, defaults to false
33-
* `name`: *'javascript'|'hiredis'|'auto'|null*; optional, defaults to hiredis and falls back to the js parser if not available or if the stringNumbers option is choosen. Setting this to 'auto' or null is going to automatically determine what parser is available and chooses that one.
34-
* `stringNumbers`: *boolean*; optional, defaults to false. This is only available for the javascript parser at the moment!
33+
* `stringNumbers`: *boolean*; optional, defaults to false
3534

3635
### Example
3736

@@ -55,8 +54,7 @@ var parser = new Parser({
5554
},
5655
returnFatalError: function (err) {
5756
lib.returnFatalError(err);
58-
},
59-
name: 'auto' // This returns either the hiredis or the js parser instance depending on what's available
57+
}
6058
});
6159

6260
Library.prototype.streamHandler = function () {
@@ -82,30 +80,21 @@ var parser = new Parser({
8280
returnError: function(err) {
8381
lib.returnError(err);
8482
},
85-
name: 'javascript', // Use the Javascript parser
8683
stringNumbers: true, // Return all numbers as string instead of a js number
8784
returnBuffers: true // All strings are returned as buffer e.g. <Buffer 48 65 6c 6c 6f>
8885
});
8986

9087
// The streamHandler as above
9188
```
9289

93-
## Further info
94-
95-
The [hiredis](https://github.com/redis/hiredis) parser is still the fasted parser for
96-
Node.js and therefor used as default in redis-parser if the hiredis parser is available.
97-
98-
Otherwise the pure js NodeRedis parser is chosen that is almost as fast as the
99-
hiredis parser besides some situations in which it'll be a bit slower.
100-
10190
## Protocol errors
10291

103-
To handle protocol errors (this is very unlikely to happen) gracefully you should add the returnFatalError option, reject any still running command (they might have been processed properly but the reply is just wrong), destroy the socket and reconnect.
92+
To handle protocol errors (this is very unlikely to happen) gracefully you should add the returnFatalError option, reject any still running command (they might have been processed properly but the reply is just wrong), destroy the socket and reconnect. Be aware that while doing this, no new command may be added, so all new commands have to be buffered in the meanwhile.
10493
Otherwise a chunk might still contain partial data of a following command that was already processed properly but answered in the same chunk as the command that resulted in the protocol error.
10594

10695
## Contribute
10796

108-
The js parser is already optimized but there are likely further optimizations possible.
97+
The parser is already optimized but there are likely further optimizations possible.
10998

11099
```
111100
npm install

changelog.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## v.2.0.0 - 0x May, 2016
2+
3+
The javascript parser got completly rewritten by [Michael Diarmid](https://github.com/Salakar) and [Ruben Bridgewater](https://github.com/BridgeAR) and is now a lot faster than the hiredis parser.
4+
Therefore the hiredis parser was removed and is only used for testing purposes and benchmarking comparison.
5+
6+
All Errors returned by the parser are from now on of class ReplyError
7+
8+
Features
9+
10+
- Added ReplyError Class
11+
- Added parser benchmark
12+
13+
Removed
14+
15+
- Dropped support of hiredis
16+
- The `name` option is "removed"
17+
- It is still available for backwards compatibility but it is strongly recommended not to use it
18+
119
## v.1.3.0 - 27 Mar, 2016
220

321
Features

lib/javascript.js

Lines changed: 0 additions & 268 deletions
This file was deleted.

0 commit comments

Comments
 (0)