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

Simpler way to trigger projections #139

Merged
merged 7 commits into from
Jun 4, 2023
Merged

Conversation

dgafka
Copy link
Member

@dgafka dgafka commented Jun 4, 2023

This PR, introduces new way of triggering projections.

Old solution

Before each Projection's Event Handler was connected directly to Event Bus. As we did not want to trigger the Event Handler directly, as we needed to pull the events from Event Stream (Stream Source), it required bit of complex solution of intercepting the Event Handler checking what kind of execution it's and based on that execute projection instead or skip if that was polling projection.

New solution

New solution reorganizes the flow, so it does not require conditional flow changes.
Whenever we register Event Handler that is connected to Stream Source, it will not connect it to the Event Bus.

Polling

If polling consumer was chosen for the projection. It will register polling consumer that will continuesly pull the stream from database. No extra configuration needed.

Synchronous Event-Driven

If synchronous event driven was chosen, we connect the Projection (instead of Event Handler) to the Event Bus.

Asynchronous Event-Driven

If asynchronous event driven was chosen, we set up Projection as asynchronous after connecting it to the Event Bus

@dgafka dgafka merged commit 92b3118 into main Jun 4, 2023
@dgafka dgafka deleted the simpler-way-to-trigger-projections branch June 6, 2023 18:12
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.

1 participant