Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New factory which correctly wraps the event store. #10

Merged
merged 2 commits into from
Sep 26, 2017
Merged

Conversation

lunetics
Copy link
Member

We now added a default EventStoreFactory and a default ActionEventEmitterFactory.

Event Store

As discussed, imho we should not abstract too much in the symfony implementation. Building some wrapper around the event store creation feels cumbersome and is imho unneded. A user just have to configure his own event store.

  Prooph\EventStore\Pdo\PostgresEventStore:
        arguments:
            - '@Prooph\Common\Messaging\FQCNMessageFactory'
            - '@event_store.pdo_connection'
            - '@Prooph\EventStore\Pdo\PersistenceStrategy\PostgresAggregateStreamStrategy'

this service will be used in the store configuration under the "event_store" key (before: type)

The DefaultEventStoreFactory now wraps (if configured) the configured EventStore in an (Transactional)ActionEventEmitter.

The DefaultActionEventEmitterFactory wraps either ActionEventEmitterEventStore or TransactionalEventEmitterEventStore, depending if TransactionalEventStore is implemented by the EventStore

ActionEventEmitter

The event_emitter config key now only accepts and validates a string of the classname (FQCN) which implements the ActionEventEmitter interface.

So now it's possible to build an own ActionEventEmitterFactory with a custom ActionEventEmitter implementation

Some ideas:

  • Also add the plugin check (implements) into the compilerpass (earlier detection)
  • Give the option to also have a custom event_emitter factory for each store (service / class?)

use Prooph\EventStore\Plugin\Plugin;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Psr\Container\ContainerInterface;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean the minimal requirement is Symfony 3.3 now? Probably we should stick to LTS versions i.e. 2.8 until 3.4 is released.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lunetics Can we support Symfony 2.8 too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched back to Symfony\Component\DI
thx @vilnitsky for the hint

@codeliner codeliner changed the title [WIP] New factory which correctly wraps the event store. New factory which correctly wraps the event store. Sep 26, 2017
@codeliner codeliner merged commit 40dacba into master Sep 26, 2017
@codeliner codeliner deleted the event_factory branch September 26, 2017 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants