Running a background task using Symfony Process without having to wait for the process to finish

后端 未结 5 1519
隐瞒了意图╮
隐瞒了意图╮ 2021-02-12 22:30

After a user submits a form, I want to render a view file, and right after that I want to initiate a background task to process five MS Excel files (each may have up to 2000 row

5条回答
  •  遥遥无期
    2021-02-12 23:14

    There is a bundle called AsyncServiceCallBundle which allows you to call your service's methods in background.

    You can refer this answer for more details about how it is done internally. Everything you need is to invoke your service's method as follows:

    $this->get('krlove.async')->call('service_id', 'method', [$arg1, $arg2]);
    

提交回复
热议问题