bernardphp/bernard — pull request #60 by ukautz (2013-08-01 15:02:34+00:00)
Title: Builder draft

As discussed. See example below for shortest code with this builder draft.

``` php
/*** CONSUMER EXAMPLE ***/

use Bernard\Builder;
use Bernard\Driver\IronMqDriver;

$builder = new Builder(new IronMqDriver(new IronMq(/* .. */)));
$queues = $builder->getQueueFactory();
$consumer = $builder->createConsumer(array('SendMail', new WorkerService));
$consumer->consume($queues->create('mails'));

/*** PRODUCER EXAMPLE ***/

use Bernard\Builder;
use Bernard\Driver\IronMqDriver;
use Bernard\Driver\DefaultMessage;

$builder = new Builder(new IronMqDriver(new IronMq(/* .. */)));
$producer = $builder->createProducer();
$producer->produce(new DefaultMessage('SendMail', array('foo' => 'bar')));
```