Skip to content
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

document pipelining #49

Closed
mranney opened this issue Dec 30, 2010 · 7 comments
Closed

document pipelining #49

mranney opened this issue Dec 30, 2010 · 7 comments

Comments

@mranney
Copy link
Contributor

mranney commented Dec 30, 2010

node_redis pipelines sort of automatically. This is quite a bit different than in other Redis client libraries, and it needs to be documented.

@rjack
Copy link

rjack commented Apr 1, 2011

Does this mean that commands are serialized so that

client.set("key", "value");
client.set("key", "new value");
client.get("key", redis.print);

is always guaranteed to print new_value because commands are queued and sent in order, even if the single command calls are async?

Sorry if I'm asking an obvious question, but I still have to get used to node async paradigm.

@mranney
Copy link
Contributor Author

mranney commented Apr 2, 2011

Yes, the commands on a single client connection are always run in order, and
the callbacks are always invoked in order.

On Fri, Apr 1, 2011 at 12:42 AM, rjack <
reply@reply.github.com>wrote:

Does this mean that commands are serialized so that

client.set("key", "value");
client.set("key", "new value");
client.get("key", redis.print);

is always guaranteed to print new_value because commands are queued and
sent in order, even if the single command calls are async?

Sorry if I'm asking an obvious question, but I still have to get used to
node async paradigm.

Reply to this email directly or view it on GitHub:
#49 (comment)

@rjack
Copy link

rjack commented Apr 2, 2011

Thanks :)

@courtneycouch
Copy link

Took a look around the source and don't see any logic to handle pipelining, and watching network activity while using node_redis I don't see any "automatic pipelining".

Might have just missed the pipelining pieces when looking around. Any chance for some quick addition to the README with a short example of pipelining a set of commands?

@mranney
Copy link
Contributor Author

mranney commented Jun 13, 2011

Pipelining means sending a command without waiting for the response from the previous one. If you do this:

client.set("key1", "val1");
client.set("key2", "val2");

This will be pipelined. The second client.set command is sent before waiting for the response from the first set command .

@mranney mranney closed this as completed Jun 13, 2011
@courtneycouch
Copy link

Ok so this is different than what pipelining means for redis I believe where
multiple commands can be sent simultaneously on the same connection. Then
results are delivered back together. Like a single batch of commands.
On Jun 12, 2011 5:30 PM, "mranney" <
reply@reply.github.com>
wrote:

@jhuttner
Copy link

Is a single TCP connection connection used in the client.set("key1"); client.set("key2") example above, Matt? If not, then I don't think node_redis is pipelining in the technical sense of the word. Seems to me like this example results in two requests to the redis server, and two separate responses - the lack of a callback means the library simply doesn't execute a callback. Is this the correct understanding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants