From 8665be430000211e58b2b84e44bd4e67e3acf47f Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Sat, 17 May 2025 21:51:34 +0200 Subject: [PATCH] Use streaming to create runtimes with the executor --- src/Executor/Executor.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index c381ceeae3..0bf2ab57ad 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -97,7 +97,11 @@ class Executor ]; $endpoint = $this->selectEndpoint($projectId, $deploymentId); - $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout); + + $body = ''; + $response = $this->call($endpoint, self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout, callback: function ($chunk) use ($body) { + $body .= $chunk; + }); $status = $response['headers']['status-code']; if ($status >= 400) { @@ -105,7 +109,7 @@ class Executor throw new \Exception($message, $status); } - return $response['body']; + return $body; } /**