2121
2222namespace MacFJA \RediSearch \Redis \Client ;
2323
24- use function Amp \Promise \all ;
2524use function Amp \Promise \wait ;
2625use Amp \Redis \Redis ;
2726use function function_exists ;
@@ -39,7 +38,7 @@ private function __construct(Redis $redis)
3938 if (!static ::supports ($ redis )) {
4039 throw new RuntimeException ($ this ->getMissingMessage ('Amp\Redis ' , false , [
4140 Redis::class => ['query ' ],
42- ], ['\\Amp \\Promise \\wait ' , '\\ Amp \\ Promise \\ all ' ]));
41+ ], ['\\Amp \\Promise \\wait ' ]));
4342 }
4443 $ this ->redis = $ redis ;
4544 }
@@ -65,19 +64,21 @@ public static function supports($redis): bool
6564 {
6665 return $ redis instanceof Redis
6766 && method_exists ($ redis , 'query ' )
68- && function_exists ('\\Amp \\Promise \\wait ' )
69- && function_exists ('\\Amp \\Promise \\all ' );
67+ && function_exists ('\\Amp \\Promise \\wait ' );
7068 }
7169
72- protected function doPipeline (Command ...$ commands ): array
70+ public function pipeline (Command ...$ commands ): array
7371 {
7472 false === static ::$ disableNotice
7573 && trigger_error ('Warning, \\Amp \\Redis \\Redis don \'t use a real Redis Pipeline ' , E_USER_NOTICE );
7674
77- return wait (all (
78- array_map (function (Command $ command ) {
79- return $ this ->redis ->query ($ command ->getId (), ...array_map ('strval ' , $ command ->getArguments ()));
80- }, $ commands )
81- ));
75+ return array_map (function (Command $ command ) {
76+ return $ this ->execute ($ command );
77+ }, $ commands );
78+ }
79+
80+ protected function doPipeline (Command ...$ commands ): array
81+ {
82+ return [];
8283 }
8384}
0 commit comments