2
0

services.yaml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. services:
  2. _defaults:
  3. autowire: true # Automatically injects dependencies
  4. autoconfigure: true # Automatically registers services as commands, event subscribers, etc.
  5. public: false # Services are private by default
  6. # 1. Transport Service
  7. # The concrete class and DSN are set dynamically by the Extension based on bundle config.
  8. Michel\PQueue\Transport\TransportInterface:
  9. public : true
  10. factory: ['%pqueue.transport.class%', 'create']
  11. arguments:
  12. - '%pqueue.transport.options%' # DSN comes from bundle config
  13. # 4. PQueueConsumerFactory Service
  14. # This factory encapsulates the logic for discovering and resolving handlers.
  15. Michel\PQueue\PQueueConsumerFactory:
  16. public : true
  17. arguments:
  18. - '@Michel\PQueueBundle\HandlerResolver\SymfonyHandlerResolver' # Injects the resolver
  19. - '%pqueue.handlers.map%' # Injects handler sources from bundle config
  20. Michel\PQueue\PQueueDispatcher:
  21. public : true
  22. arguments:
  23. - '@Michel\PQueue\Transport\TransportInterface' # Injects the resolver
  24. -
  25. Michel\PQueue\PQueueConsumer:
  26. public : true
  27. factory: ['@Michel\PQueue\PQueueConsumerFactory', 'createConsumer']
  28. # 6. Bundle Command
  29. Michel\PQueueBundle\Command\:
  30. resource: '../../../src/Command/*'
  31. tags: ['console.command']
  32. public: true
  33. autowire: true