false ]; if ($queueService->run($request)) { $output['success'] = true; } return $this->withJson($response, $output); } public function jobs(ServerRequestInterface $request, ResponseInterface $response, Service\Queue $queueService): ResponseInterface { $output = [ 'jobs' => array_column($queueService->getPendingJobs(), 'id') ]; return $this->withJson($response, $output); } public function run(ServerRequestInterface $request, ResponseInterface $response, Service\Queue $queueService, int $job_id): ResponseInterface { if ($queueService->runJob($job_id, $request)) { return $response->withStatus(200); } return $response->withStatus(422); } }