Page MenuHomeDevCentral

Broker factory
ClosedPublic

Authored by dereckson on Jan 12 2016, 00:27.
Tags
None
Referenced Files
F3632188: D225.diff
Sun, Oct 6, 20:28
Unknown Object (File)
Fri, Oct 4, 07:47
Unknown Object (File)
Wed, Oct 2, 05:55
Unknown Object (File)
Wed, Oct 2, 05:55
Unknown Object (File)
Wed, Oct 2, 05:51
Unknown Object (File)
Wed, Oct 2, 05:43
Unknown Object (File)
Tue, Oct 1, 10:29
Unknown Object (File)
Tue, Oct 1, 10:09
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.