Skip to content

Commit dc84613

Browse files
committed
minor symfony#17405 Add paragraph about symfony-cli workers (xelaris)
This PR was merged into the 4.4 branch. Discussion ---------- Add paragraph about symfony-cli workers While having a look at the source code of the symfony-cli, I discovered this pretty handy feature of starting worker processes along with `symfony serve`. I couldn't find any documentation about this though, not even any hint about the config file. See https://github.com/symfony-cli/symfony-cli/blob/main/local/project/config.go Commits ------- c3d877a Add paragraph about symfony-cli workers
2 parents 39968d2 + c3d877a commit dc84613

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

setup/symfony_server.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,31 @@ server provides a ``run`` command to wrap them as follows:
277277
# stop the web server (and all the associated commands) when you are finished
278278
$ symfony server:stop
279279
280+
Configuring Workers
281+
-------------------
282+
283+
If you like processes to start automatically, along with the webserver
284+
(``symfony server:start``), you can add a configuration file to your project:
285+
286+
.. code-block:: yaml
287+
288+
# .symfony.local.yaml
289+
workers:
290+
# pre-defined command to build and watch front-end assets
291+
# yarn_encore_watch:
292+
# cmd: ['yarn', 'encore', 'dev', '--watch']
293+
yarn_encore_watch: ~
294+
295+
# pre-defined command to start messenger consumer
296+
# messenger_consume_async:
297+
# cmd: ['symfony', 'console', 'messenger:consume', 'async']
298+
# watch: ['config', 'src', 'templates', 'vendor']
299+
messenger_consume_async: ~
300+
301+
# additional commands
302+
spa:
303+
cmd: ['yarn', '--cwd', './spa/', 'dev']
304+
280305
Docker Integration
281306
------------------
282307

0 commit comments

Comments
 (0)