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

EventMachine Watch #22

Closed
codeliner opened this issue Jan 5, 2018 · 0 comments
Closed

EventMachine Watch #22

codeliner opened this issue Jan 5, 2018 · 0 comments

Comments

@codeliner
Copy link
Member

codeliner commented Jan 5, 2018

$eventMachine->watch(Stream::ofWriteModel() || Stream::ofService('service_name', 'stream-projection-name')) //Resolved to service event stream, if no stream-projection-name given
    ->with('projection-name', Projector::class) 
    //DocumentProjector::__invoke($prjState, DocumentReadModel $readModel, Message $event)
    //StreamProjector::__invoke($prjState, StreamReadModel $readModel, Message $event)
    ->filterAggregateType('Aggregate\Type') //Optional
    ->filterEvents(array $listOfEventNames) //Optional
    ->storeDocumentsWithSchema(JsonSchema::object([...])); //JsonSchema of the stored read model documents
    //->storeAsStream(); //Alternative to ->storeDocumentsWithSchema()
  • Simple implementation is a single prooph projection: EventStreamWatcher
  • $prjState is the one provided by prooph
  • DocumentReadModel is a wrapper around simple document store (see Document projections #27)
    • JsonSchema is translated into GraphQL Schema and projection read model can be queried by GraphQL
  • StreamReadModel is a wrapper around event store (see StreamToStream projections #29)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Event Machine
  
Done
Development

No branches or pull requests

1 participant