-
Notifications
You must be signed in to change notification settings - Fork 67
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
Lazy socket-binding and pipelining, for better predis support #27
base: master
Are you sure you want to change the base?
Conversation
…r error/status handler functionality
Hi @stokes3452, Just give me a a couple of days and I'll be sure to get back to you, I'm currently a bit busy but I'm interested in these changes! |
I finally have some time for phpiredis, sorry for the wait! I have only a few notes for now:
|
About the 2nd point I think I understand now why you decided to go with an optional I still prefer my proposal (avoiding the optional protected function createResource()
{
$stream = parent::createResource();
$phpiredis = phpiredis_create_from_stream($stream);
$reader = phpiredis_get_reader($phpiredis);
phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());
phpiredis_reader_set_error_handler($reader, $this->getErrorHandler());
return $phpiredis;
} Now I wonder if it could be useful to have a |
I just noticed that |
Ping @stokes3452? |
Sorry, got busy and completely lost track of this. Commit incoming, with function rename and a set_reader function instead of the optional $reader parameter. I went with an optional set_reader call over an optional get_reader call, so that people who don't want to have a reader associated with their context don't have to. What's the new structure in the test suite? |
…in favor of a set_reader function
Don't worry @stokes3452 I just pinged you to keep the PR alive, I too got suddenly busy again so I couldn't reply sooner :-) The structure and layout of the test suite has been recently changed in the master branch to make it a bit more tidy, you should probably merge these changes back into your branch but I can do it myself when merging locally. On a related note, I've informally asked if there were plans to tag a new release of hiredis given the good amount of changes since the last release (and one of those changes is the very |
Adds the ability to create a phpiredis connection from an existing socket.
Also adds the ability to append commands to the redisContext (which will be flushed on demand before eventual reads), and read them back one at a time. When these are dropped into Predis's PhpiredisStreamConnection, performance increases dramatically.