chill-bundles/.changes/unreleased/DX-20250407-121010.yaml
Julien Fastré cfcecf1cdc
Refactor export management and configure messenger queue
Refactored the export initialization process by implementing the `ExportManagerAwareInterface` for better consistency. Added configuration to enable handling export requests via the messenger queue for improved task prioritization and execution efficiency.
2025-04-25 18:24:37 +02:00

45 lines
1.3 KiB
YAML

kind: DX
body: |
Rewrite exports to run them asynchronously
changelog: |
- Add new methods to serialize data using the rector rule
- Remove all references to the Request in filters, aggregators, filters. Actually, the most frequent occurence is `$security->getUser()`.
- Refactor manually the initializeQuery method
- Remove the injection of ExportManager into the constructor of each export element:
```diff
- class MyFormatter implements FormatterInterface
+ class MyFormatter implements FormatterInterface, \Chill\MainBundle\Export\ExportManagerAwareInterface
{
+ use \Chill\MainBundle\Export\Helper\ExportManagerAwareTrait;
- public function __construct(private ExportManager $exportmanager) {}
public function MyMethod(): void
{
- $this->exportManager->getFilter('alias');
+ $this->getExportManager()->getFilter('alias');
}
}
```
- configure messenger to handle export in a queue:
```diff
# config/packages/messenger.yaml
framework:
messenger:
routing:
+ 'Chill\MainBundle\Export\Messenger\ExportRequestGenerationMessage': priority
```
time: 2025-04-07T12:10:10.682561327+02:00
custom:
Issue: ""
SchemaChange: Add columns or tables