I use prooph(https://github.com/prooph) so I have my write model, where I store events like below(aggregate table):
when I run projection in background using command:
php bin/console event-store:projection:run card_projection
I have read model like below:
In front of my background application I have rest API, where I create event:
CardWasAdded
through url:
POST /cards
and I receive code 201.
After that I refresh my list through url:
GET /cards
The issue is that sometimes this new event is not processed by projection. So the question is:
How to manage that issue?
- Should I wait 2 sec or some time?(ugly hack for me).
- Should I process event after is inserted - not use projection process in background?