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

Refactored the event store definition to include the optimistic concurrency checks #12

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

oskardudycz
Copy link
Collaborator

@oskardudycz oskardudycz commented Feb 14, 2024

  • Adjusted typing to keep StreamVersion part of the Event Store definition, defaulting to bigint.
  • Added typings for input options and results to include cases where the stream may not exist and the user provides the expected version (or not).
  • Made aggregateStream and readStream methods take expectedStreamVersion to fail fast.
  • Adjusted DeciderCommandHandler definition to reuse regular CommandHandler

@watfordsuzy FYI

Relates to #10, the InMemory and EventStoreDB implementations will come in the follow up PRs.

…rrency checks

Adjusted typing to keep StreamVersion part of the Event Store definition, defaulting to bigint.

Added typings for input options and result to include cases where stream may not exists and user provides expected version (or not).

Made aggregateStream and readStream method take expectedStreamVersion to fail fast.
@oskardudycz oskardudycz force-pushed the optimistic_concurrency branch from e36273d to c2edf2e Compare February 14, 2024 10:27
@oskardudycz oskardudycz merged commit 9273e9d into main Feb 14, 2024
1 check passed
@oskardudycz oskardudycz deleted the optimistic_concurrency branch February 14, 2024 10:43
@oskardudycz oskardudycz added enhancement New feature or request core labels Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant