Page MenuHomeDevCentral

Broker factory
ClosedPublic

Authored by dereckson on Jan 12 2016, 00:27.
Tags
None
Referenced Files
F3749348: D225.id530.diff
Sat, Nov 16, 14:40
Unknown Object (File)
Fri, Nov 15, 01:16
Unknown Object (File)
Wed, Nov 13, 13:49
Unknown Object (File)
Wed, Nov 13, 02:44
Unknown Object (File)
Thu, Nov 7, 18:06
Unknown Object (File)
Thu, Nov 7, 03:02
Unknown Object (File)
Thu, Nov 7, 02:35
Unknown Object (File)
Thu, Oct 31, 14:51
Subscribers
None

Details

Summary

Applications consuming our library wants generally to declare the broker
in the configuration, including its type.

We provide a BrokerFactory::make method to instanciate a broker with
an array like this:

[
    "driver" => "amqp",
    "host" => "rabbit.domain.tld",
    "port" => "5672",
    "username" => "lorem",
    "password" => "ipsum",
    "vhost" => "dolor",
]

The file drivers.php contains the map between the drivers names
and the classses to load.

Each broker class implements a makeFromConfig ($params) static method
to build an object from such array.

The BrokerFactory::make method gets from drivers.php the correct class,
then calls makeFromConfig and returns the result.

Test Plan

Run tests

Diff Detail

Repository
rKBROKER Keruald Broker
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson retitled this revision from to Broker factory.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson edited the test plan for this revision. (Show Details)
dereckson edited edge metadata.
This revision is now accepted and ready to land.Jan 12 2016, 00:29
This revision was automatically updated to reflect the committed changes.