wwwision / subscription-engine-dcb-adapter
wwwision/dcb-eventstore adapter for wwwision/subscription-engine
Fund package maintenance!
bwaidelich
Paypal
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 1
Type:package
Requires
- php: >=8.3
- wwwision/dcb-eventstore: ^4
- wwwision/subscription-engine: ^1
Requires (Dev)
- phpstan/phpstan: ^2
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^4.0.x-dev
README
wwwision/dcb-eventstore adapter for wwwision/subscription-engine
Usage
$eventStore = DoctrineEventStore::create($dbalConnection, eventTableName: 'events'); $subscriptionEngine = new SubscriptionEngine( eventStoreAdapter: new DcbEventStoreAdapter($eventStore), subscriptionStore: new DoctrineSubscriptionStore($dbalConnection, tableName: 'subscriptions'), subscribers: Subscribers::fromArray([ Subscriber::create( id: 'some-projection', handler: fn (EventEnvelope $eventEnvelope) => print($eventEnvelope->event->type->value), reset: fn () => print('resetting projection for replay'), ), Subscriber::create( id: 'some-process', handler: fn (EventEnvelope $eventEnvelope) => print('invoking process...'), runMode: RunMode::FROM_NOW, setup: fn () => print('setting up process...'), ), ]) );
Contribution
Contributions in the form of issues or pull requests are highly appreciated
License
See LICENSE