Skip to content

Commit 38c2541

Browse files
committed
Added documentation about job launcher DSN
1 parent 28d10b0 commit 38c2541

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/batch-symfony-framework/docs/getting-started.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@ yokai_batch:
2020
launcher:
2121
default: simple
2222
launchers:
23-
simple: simple://simple
24-
messenger: messenger://messenger
25-
console: console://console?log=batch_execute.log
26-
service: service://service?service=app.job_launcher.service
23+
simple: ...
24+
async: ...
2725
```
2826
2927
> **note**: if you do not configure anything here, you will be using the [`SimpleJobLauncher`](https://github.com/yokai-php/batch/blob/0.x/src/Launcher/SimpleJobLauncher.php).
@@ -44,13 +42,19 @@ final class YourAppCode
4442
private JobLauncherInterface $jobLauncher, // will inject the default job launcher
4543
private JobLauncherInterface $simpleJobLauncher, // will inject the "simple" job launcher
4644
private JobLauncherInterface $messengerJobLauncher, // will inject the "messenger" job launcher
47-
private JobLauncherInterface $consoleJobLauncher, // will inject the "console" job launcher
48-
private JobLauncherInterface $serviceJobLauncher, // will inject the "service" job launcher
4945
) {
5046
}
5147
}
5248
```
5349

50+
All `launchers` are configured using a DSN, every scheme has it's own associated factory.
51+
- `simple://simple`: a [`SimpleJobLauncher`](https://github.com/yokai-php/batch/blob/0.x/src/Launcher/SimpleJobLauncher.php), no configuration allowed
52+
- `messenger://messenger`: a [`DispatchMessageJobLauncher`](https://github.com/yokai-php/batch-symfony-messenger/blob/0.x/src/DispatchMessageJobLauncher.php), no configuration allowed
53+
- `console://console`: a [`RunCommandJobLauncher`](https://github.com/yokai-php/batch-symfony-console/blob/0.x/src/RunCommandJobLauncher.php), configurable options:
54+
- `log`: the filename where command output will be redirected (defaults to `batch_execute.log`)
55+
- `service://service`: pointing to a service of your choice, configurable options:
56+
- `service`: the id of the service to use (required, an exception will be thrown otherwise)
57+
5458
### JobExecution storage
5559

5660
You can have only one storage for your `JobExecution`, and you have several options:

0 commit comments

Comments
 (0)