php-redisearch icon indicating copy to clipboard operation
php-redisearch copied to clipboard

Amp client warning for pipeline method

Open kelunik opened this issue 4 years ago • 2 comments

Hey @MacFJA,

It's great to see support for amphp/redis built-in! Could you tell me what the notice in https://github.com/MacFJA/php-redisearch/blob/6d3a675c54fc5c9f675c50d860f2b3d50eab1972/src/Redis/Client/AmpRedisClient.php#L75 is supposed to mean?

kelunik avatar Nov 06 '21 22:11 kelunik

It's just that, AFAIK, there is not pipeline in Amp\Redis, so each command need to be send one by one, and are also executed one by one.

Where with a Redis pipeline:

  • all commands are sent to the server in one go
  • the server execute all commands
  • the server send one message containing all commands response.

With pipeline only one network request is made instead of one per command.

MacFJA avatar Nov 07 '21 13:11 MacFJA

While amphp/redis uses separate write calls, pipelining is more about avoiding the RTT cost and it's totally supported by amphp/redis. The client won't wait for a server response before sending the next command. It uses pipelining by default.

kelunik avatar Nov 07 '21 14:11 kelunik