-
Notifications
You must be signed in to change notification settings - Fork 56
/
MySqlEventStoreFactory.php
63 lines (56 loc) · 2.29 KB
/
MySqlEventStoreFactory.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/**
* This file is part of prooph/pdo-event-store.
* (c) 2016-2019 Alexander Miertsch <kontakt@codeliner.ws>
* (c) 2016-2019 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Prooph\EventStore\Pdo\Container;
use Prooph\Common\Event\ProophActionEventEmitter;
use Prooph\Common\Messaging\FQCNMessageFactory;
use Prooph\EventStore\ActionEventEmitterEventStore;
use Prooph\EventStore\EventStore;
use Prooph\EventStore\Pdo\MySqlEventStore;
final class MySqlEventStoreFactory extends AbstractEventStoreFactory
{
protected function createActionEventEmitterEventStore(EventStore $eventStore): ActionEventEmitterEventStore
{
return new ActionEventEmitterEventStore(
$eventStore,
new ProophActionEventEmitter([
ActionEventEmitterEventStore::EVENT_APPEND_TO,
ActionEventEmitterEventStore::EVENT_CREATE,
ActionEventEmitterEventStore::EVENT_LOAD,
ActionEventEmitterEventStore::EVENT_LOAD_REVERSE,
ActionEventEmitterEventStore::EVENT_DELETE,
ActionEventEmitterEventStore::EVENT_HAS_STREAM,
ActionEventEmitterEventStore::EVENT_FETCH_STREAM_METADATA,
ActionEventEmitterEventStore::EVENT_UPDATE_STREAM_METADATA,
ActionEventEmitterEventStore::EVENT_FETCH_STREAM_NAMES,
ActionEventEmitterEventStore::EVENT_FETCH_STREAM_NAMES_REGEX,
ActionEventEmitterEventStore::EVENT_FETCH_CATEGORY_NAMES,
ActionEventEmitterEventStore::EVENT_FETCH_CATEGORY_NAMES_REGEX,
])
);
}
protected function eventStoreClassName(): string
{
return MySqlEventStore::class;
}
public function defaultOptions(): iterable
{
return [
'load_batch_size' => 1000,
'event_streams_table' => 'event_streams',
'message_factory' => FQCNMessageFactory::class,
'wrap_action_event_emitter' => true,
'metadata_enrichers' => [],
'plugins' => [],
'disable_transaction_handling' => false,
'write_lock_strategy' => null,
];
}
}