0

I'm looking at the example of the Worker+IronMq.

http://fortrabbit.com/docs/in-depth/workers/scheduler-example

The question is how can I call a specific service in Symfony2 from the worker?

Websirnik
  • 1,372
  • 3
  • 21
  • 35

1 Answers1

3

The stanlemon/bernard-bundle integrates bernardphp.com into symfony. Bernard supports different backends such as:

  • Predis / PhpRedis
  • Amazon SQS
  • Iron MQ
  • Doctrine DBAL

Here is an example how to use your service:

<service id="acme.demo.message_handler.api_update" class="Acme\DemoBundle\Updater\ApiUpdateMessageHandler">
    <argument type="service" id="acme.demo.updater.api"/>
    <tag name="bernard.receiver"/>
</service>
Oliver Stark
  • 186
  • 6
  • Thanks. Already looking into this. Bernard has the following code for the consumer. I assume it goes into the worker. Where should I get a `$container`from? `$serviceResolver = new \Bernard\Symfony\ContainerAwareServiceResolver($container); $serviceResolver->register('SendNewsletter', 'my.service.id'); ` – Websirnik Jan 23 '14 at 15:01