# Fork process and return responder?

**URL:** <https://discourse.slimframework.com/t/fork-process-and-return-responder/1687>\
**Category:** Questions\
**Created:** [July 23, 2017, 12:15am UTC](https://discourse.slimframework.com/t/fork-process-and-return-responder/1687 "2017-07-23T00:15:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shayo](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@shayo](https://discourse.slimframework.com/u/shayo)\
**Post date:** [July 23, 2017, 12:15am UTC](https://discourse.slimframework.com/t/fork-process-and-return-responder/1687/1 "2017-07-23T00:15:10Z")

</div>

Newbie question (might be more related to php than slim…)  
Say I have a long job that needs to be executed for a specific route, but I want to return immediately a respond saying “job started”.  
How do I start the long job in php?

$app-\>get(’/submitJob’, function (Request $request, Response $response) {  
$response-\>getBody()-\>write(“Job in progress…”);

// How do I start a new process here to do some serious work on the server, but return immediately the response to the client?  
return $response;  
});

---

<div class="post-metadata">

**Author:** ![akrabat](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/akrabat/32/9_2.png) [@akrabat](https://discourse.slimframework.com/u/akrabat)\
**Post date:** [July 24, 2017, 6:28am UTC](https://discourse.slimframework.com/t/fork-process-and-return-responder/1687/2 "2017-07-24T06:28:48Z")

</div>

Use a queue system like beanstalkd, RabbitMQ or Gearman.

---

<div class="post-metadata">

**Author:** ![shayo](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@shayo](https://discourse.slimframework.com/u/shayo)\
**Post date:** [July 24, 2017, 12:59pm UTC](https://discourse.slimframework.com/t/fork-process-and-return-responder/1687/3 "2017-07-24T12:59:31Z")

</div>

Gotcha. Thanks for the tips!
