Skip to content

Commit 0f34892

Browse files
authored
Merge pull request #27 from php-api-clients/command-bus-cache
Support command bus command handler mapping caching for faster bootuptimes
2 parents e274d8b + ae074e6 commit 0f34892

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Factory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ private static function createContainer(
4646
Hydrator::class => function (LoopInterface $loop, CommandBusInterface $commandBus) use ($options) {
4747
return self::createHydrator($loop, $commandBus, $options);
4848
},
49-
CommandBusInterface::class => function (ContainerInterface $container) {
50-
return CommandBusFactory::create($container);
49+
CommandBusInterface::class => function (ContainerInterface $container) use ($options) {
50+
return CommandBusFactory::create($container, $options[Options::COMMAND_BUS_OPTIONS] ?? []);
5151
},
5252
]);
5353
$builder->addDefinitions($options[Options::CONTAINER_DEFINITIONS] ?? []);

src/Options.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ final class Options
99
const TRANSPORT = 'transport';
1010
const TRANSPORT_OPTIONS = 'transport_options';
1111
const CONTAINER_DEFINITIONS = 'container_definitions';
12+
const CONTAINER = 'container';
13+
const COMMAND_BUS_OPTIONS = 'command_bus_options';
1214
}

0 commit comments

Comments
 (0)