Comparing version
@@ -5,2 +5,4 @@ var path = require('path') | ||
, MONITOR = Constants.MAP.monitor.name | ||
, SUBSCRIBE = Constants.MAP.subscribe.name | ||
, PSUBSCRIBE = Constants.MAP.psubscribe.name | ||
, create = require('jsr-client') | ||
@@ -157,2 +159,8 @@ , Format = require('jsr-format').Format | ||
function isBlocking() { | ||
return this.cmd === MONITOR | ||
|| this.cmd === SUBSCRIBE | ||
|| this.cmd === PSUBSCRIBE; | ||
} | ||
/** | ||
@@ -176,3 +184,3 @@ * Print a server response. | ||
} | ||
if(this.ps && this.cmd !== MONITOR) { | ||
if(this.ps && !this.isBlocking()) { | ||
this.ps.resume(); | ||
@@ -445,4 +453,5 @@ } | ||
CliClient.prototype.parse = parse; | ||
CliClient.prototype.isBlocking = isBlocking; | ||
CliClient.prototype.createConnection = createConnection; | ||
module.exports = CliClient; |
@@ -25,5 +25,12 @@ var Constants = require('jsr-constants'); | ||
i++; | ||
if(i === repeat) { | ||
if(i === repeat && !cli.isBlocking()) { | ||
process.exit(errors ? 1 : 0); | ||
} | ||
// blocking command operation cannot repeat | ||
if(cli.isBlocking()) { | ||
if(errors) process.exit(1); | ||
return; | ||
} | ||
if(!interval) return doExec(); | ||
@@ -30,0 +37,0 @@ setTimeout(doExec, interval); |
{ | ||
"name": "jsr", | ||
"description": "Redis toolkit.", | ||
"version": "0.2.19", | ||
"version": "0.2.20", | ||
"author": "muji <noop@xpm.io>", | ||
@@ -50,2 +50,3 @@ "repository": { | ||
"developer.md", | ||
"credits.md", | ||
"license.md" | ||
@@ -52,0 +53,0 @@ ] |
@@ -21,2 +21,3 @@ Table of Contents | ||
* [Readme](#readme) | ||
* [Credits](#credits) | ||
* [License](#license) | ||
@@ -177,5 +178,11 @@ | ||
## Credits | ||
Thanks to [@antirez](https://github.com/antirez) and all the other redis contributors for excellent software and very good documentation, especially for `COMMAND` which made developing this program much easier. | ||
Thanks to [@codeaholics](https://github.com/codeaholics) for the [rdb](https://github.com/freeformsystems/jsr-rdb) code which saved *a lot* of time. | ||
## License | ||
Everything is [MIT](http://en.wikipedia.org/wiki/MIT_License). Read the [license](https://github.com/freeformsystems/jsr/blob/master/LICENSE) if you feel inclined. | ||
The [redis](http://redis.io) documentation reproduced by `jsrc(1)` is *Creative Commons 3 Attribution and Share-Alike*, everything else is [MIT](http://en.wikipedia.org/wiki/MIT_License). Read the [license](https://github.com/freeformsystems/jsr/blob/master/LICENSE) if you feel inclined. | ||
@@ -207,1 +214,3 @@ Generated by [mdp(1)](https://github.com/freeformsystems/mdp). | ||
[ps-test]: https://github.com/freeformsystems/jsr-server/blob/master/test/spec/ps/connect.js | ||
[@antirez]: https://github.com/antirez | ||
[@codeaholics]: https://github.com/codeaholics |
97897
1.07%3402
0.38%214
4.39%