Introduce new RedisCmd based command construction

* Introduce a new `RedisCmd` struct to dynamically append RESP arguments
  such that we don't have to precalculate the number of arguments the
  command will have up front.

  Additionally the new `RedisCmd allows both a `void *` context pointer
  but also can attach a `void (*ctx_dtor)(void*)` destructor so we are
  still able to clean up any allocated context when commands fail.

  This moves the context cleanup out of every individual reply handler
  and into the generic processing wrappers.

* Create a small group of `resp_str` helper functions for lower level
  concatination of RESP protocol data over the wire.

* Lots of small modernization of the codebase such as using
  `zend_string*` instead of (`char *`, `size_t`) pairs.

* Greatly simplify `crosslot` handling logic
This commit is contained in:
michael-grunder
2026-05-21 21:31:26 -07:00
committed by Michael Grunder
parent 640ed13fcc
commit 2c5ef19257
22 changed files with 4573 additions and 5135 deletions
+2
View File
@@ -178,6 +178,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
<file role="src" name="redis_cluster.stub.php"/>
<file role="src" name="redis_cluster_arginfo.h"/>
<file role="src" name="redis_cluster_legacy_arginfo.h"/>
<file role="src" name="redis_cmd.c"/>
<file role="src" name="redis_cmd.h"/>
<file role="src" name="redis_commands.c"/>
<file role="src" name="redis_commands.h"/>
<file role="src" name="redis_session.c"/>