Use streaming to create runtimes with the executor

This commit is contained in:
Torsten Dittmann
2025-05-17 21:51:34 +02:00
parent 1888606eec
commit 8665be4300
+6 -2
View File
@@ -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;
}
/**