Skip to content

Commit 906b05a

Browse files
wording changes
1 parent 6c80086 commit 906b05a

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

docs/fr/worker.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
Démarrez votre application une fois et gardez-la en mémoire.
44
FrankenPHP traitera les requêtes entrantes en quelques millisecondes.
55

6-
## Un changement de paradigme
7-
8-
Attention, ce mode ajoute un nouveau paradigme de développement. Si votre code n'est pas stateless (sans état), l'activation du mode worker risque d'introduire des comportements inattendus.
6+
## Persistance d'état et Workers
97

108
Contrairement au modèle PHP-FPM traditionnel, l'application reste chargée en mémoire entre les requêtes. Par conséquent, tout état stocké dans vos services (propriétés d'objet, singletons, etc.) sera conservé et partagé entre les requêtes successives traitées par le même worker. Cela peut entraîner des fuites de données ou des états incohérents si votre application n'est pas conçue pour cela.
119
L'article suivant résume très bien ce problème et explique comment y remédier, notamment pour les applications Symfony en utilisant ResetInterface pour garantir que vos services sont "propres" à chaque nouvelle requête.
@@ -14,7 +12,7 @@ L'article suivant résume très bien ce problème et explique comment y remédie
1412

1513
- Article (EN) : [Getting your Symfony app ready for Swoole, RoadRunner, and FrankenPHP](https://dev.to/sergiid/getting-symfony-app-ready-for-swoole-roadrunner-and-frankenphp-no-ai-involved-2d0g) - Explique le problème en détail et présente des solutions.
1614
- Symfony : La [documentation de Messenger](https://symfony.com/doc/current/messenger.html#stateless-worker) aborde également ce concept de "stateless worker".
17-
- Outil : [phanalist](https://github.com/denzyldick/phanalist) est un analyseur statique (mentionné dans l'article) qui peut vous aider à détecter les services "stateful" dans votre code.
15+
- Outil : [phanalist](https://github.com/denzyldick/phanalist) est un analyseur statique qui peut vous aider à détecter les services "stateful" dans votre code.
1816

1917
## Démarrage des scripts workers
2018

docs/worker.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
Boot your application once and keep it in memory.
44
FrankenPHP will handle incoming requests in a few milliseconds.
55

6-
## A Paradigm Shift
7-
8-
Warning: This mode introduces a new development paradigm. If your code is not stateless, enabling worker mode risks introducing unexpected behavior.
6+
## State Persistence and Workers
97

108
Unlike with the traditional PHP-FPM model, the application remains loaded in memory between requests. Consequently, any state stored in your services (object properties, singletons, etc.) will be preserved and shared across successive requests handled by the same worker. This can lead to data leaks or inconsistent states if your application is not designed for it.
119
The following article summarizes this issue very well and explains how to fix it, notably for Symfony applications using ResetInterface to ensure your services are "clean" for every new request.
@@ -14,7 +12,7 @@ The following article summarizes this issue very well and explains how to fix it
1412

1513
- Article: [Getting your Symfony app ready for Swoole, RoadRunner, and FrankenPHP](https://dev.to/sergiid/getting-symfony-app-ready-for-swoole-roadrunner-and-frankenphp-no-ai-involved-2d0g) - Explains the problem in detail and presents solutions.
1614
- Symfony: [The Messenger](https://symfony.com/doc/current/messenger.html#stateless-worker) documentation also discusses this "stateless worker" concept.
17-
- Tool: [phanalist](https://github.com/denzyldick/phanalist) is a static analyzer (mentioned in the article) that can help you detect "stateful" services in your code.
15+
- Tool: [phanalist](https://github.com/denzyldick/phanalist) is a static analyzer that can help you detect "stateful" services in your code.
1816

1917
## Starting Worker Scripts
2018

0 commit comments

Comments
 (0)