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

Batching support #3

Merged
merged 6 commits into from
Sep 20, 2024
Merged

Batching support #3

merged 6 commits into from
Sep 20, 2024

Conversation

fmterrorf
Copy link

No description provided.

davydog187 and others added 4 commits September 18, 2024 12:10
Skeleton code for batched handling, to be tested

Basic skeleton test

Ensure that no conflicting options/handlers are configured

Move the module compilation test into describe block

Add code to do error handling on batches (untested)

Add tests for batching error handling

Allow ack_events to take a list of events and acknowledge last event

batch handler telemetry

error handling fixes

Update support batch handler logic

Add batch handler telemetry tests

Align naming of batch handler test module

Update retry logic

Update tests

Add configuration test for ensuring batch_size and concurrency not test at same time

Fix handle_batch comparison and add test case

Add tests for handle_batch state and update last_event_seen logic

Remove list implementation for InMemory#ack_event/3

Minor update for event_handler_batch_state_test

Document handle_batch/2 for state update

Add more event handler test coverage

- upcast test for handle_batch/2
- batch_reset_event_handler_test

Do not retry if :skip is received

Commanded.options() -> Commanded.Application.options()

Allow skipping events for batched handler

Include commanded#493 and commanded#489 in CHANGELOG

Include commanded#493 and commanded#489 in CHANGELOG

Release v1.4.0

bugfix: retry command executing when the aggregator is down right before the execution

chore: improve typespec for router dispatch resp

Include commanded#494 in CHANGELOG

Remove duplicate event apply when receiving missed events published to aggregate's event stream

Update CHANGELOG

Use Erlang v25.0.4 and Elixir v1.14.0-otp-25

Require at least Elixir v1.10

Fix typespec typo in Commanded.Application

Use `:test` Mix env for GitHub workflow

To catch dialyzer and credo errors in test files.

Release v1.4.1

retry remaining batch when skipping event

only retry for batch

Reduce compile-time dependencies

Reformat

Cleanup some TODO comments that have been implemented

Remove unused code in test

Make Credo happy

Update docs for :skip return in error callback

Filter any already seen events from handle_batch

Update docs on event given to batch error hander
Format

Fix dialyzer error
lib/commanded/event/handler.ex Outdated Show resolved Hide resolved
case handler_module.handle_batch(enriched_events) do
:ok ->
telemetry_stop(start_time, telemetry_metadata, :batch)
confirm_receipt(events, state)
Copy link

Choose a reason for hiding this comment

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

We pass enriched_events to the handler callback, but the unenriched list for error handling. Would it make sense to use the enriched_events here and below?

Copy link
Author

Choose a reason for hiding this comment

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

I think I'm going to keep this as it is for now since this is also how handle_events behaves

lib/commanded/event/handler.ex Outdated Show resolved Hide resolved
lib/commanded/event/handler.ex Outdated Show resolved Hide resolved
@seth seth merged commit 5c50d3c into main-calmwave Sep 20, 2024
2 checks passed
@seth seth deleted the batching-support branch September 20, 2024 21:18
@fmterrorf fmterrorf restored the batching-support branch September 20, 2024 21:31
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.

3 participants