protected function updateWorker(\Amp\Deferred $deferred, $success, $scripts, $exception = null) { $data = ['success' => $success, 'scripts' => $scripts]; if ($exception !== null) { $data['exception'] = $exception; } $deferred->update($data); }