-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the support of unix socket #642
Conversation
delete client.host delete client.port add client.address add client.connectionOptions add tests.UNIX_SOCKET update all error message to use client.address update retry connection
By the way, it seems to overrlap/fix with issues |
This is awesome! Very complete w/ tests and docs. Releasing as 0.12.0 imminently. |
@@ -610,11 +635,16 @@ tests.CLIENT_LIST = function() { | |||
return next(name); | |||
} | |||
|
|||
var pattern = /^add=/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, typo here that breaks tests on older versions of Redis. I'll take care of this before I release.
Thanks! Published as 0.12.0 |
This is my careless. I just saw a lot Solution 1Adding Solution 2Don't throw Solution 3separate and expose createClientUnix and createClientTcp. Don't unify the creation of unix and tcp socket. No ambiguous. Solution 4Remain unchanged. Then one need to write something like this.
Personally, i prefer solution 1. As solution 2 adding support to something like Let me know which do you prefer. I am happy to submit pull request. =] |
I noted the issue #204. But, I got an error using redis.createClient('/tmp/redis.sock'). Not sure if this is because the interface of net.createConnection() changed.
Anyway, IMHO, unix socket is a useful feature that need to be there. It provides better isolation, faster performance. And yet this is not that much of work.
I removed client.host and client.port, because they do not fit for unix socket.
And add client.address and client.connectionOption. The former is better to reference addres and the later to reference the way to create connection.
I also added new test case UNIX_SOCKET and updated the testcase CHECK_LIST. This pull request pass all test cases.
Finally, README is updated.