Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

One possible alternative #1

Open
brycebaril opened this issue Nov 8, 2013 · 1 comment
Open

One possible alternative #1

brycebaril opened this issue Nov 8, 2013 · 1 comment

Comments

@brycebaril
Copy link

This isn't anything you don't know, but I find it nice to have it in front of me to reference. The flow of a typical command is (using get in this example):

client.get(..., callback)
  -> send_command (creates a "Command" instance containing callback, stuffs it onto command_queue)
    -> pipelined out to the socket

socket reply
  -> parser
    -> return_reply return_error (gets Callback instance from command_queue)
      -> try_callback
        -> callback
   or
    -> return_error
      -> callback

I haven't tried this, but one possible alternative approach would be to have node_redis expose the Command type, and the wrapper could modify or provide an alternate Command type that does the wrapping vs wrapping send_command.

I don't know if it is any better, but at the very least it would save the args sniffing.

@othiym23
Copy link
Owner

othiym23 commented Nov 8, 2013

That would be awesome! I have to keep the current approach around as a shim (because polyfills like this aren't super useful if they dictate a minimum version of the thing they're patching), but anything that saved cycles on hot paths would be useful.

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

No branches or pull requests

2 participants