Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retry command execution on concurrency error
Retry executing a command if appending events to the aggregate's stream fails with an `{:error, :wrong_expected_version}` concurrency error. The missing event(s) are fetched from the event store to update the aggregate state and attempt the command again. Aggregate instances are singletons on a single node, and cluster if using the distributed registry. However, this allows Commanded to still work when run on multiple nodes that are not connected to form a cluster.
- Loading branch information
1 parent
4964f62
commit 42e899c
Showing
8 changed files
with
228 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
alias Commanded.Aggregates.Aggregate | ||
|
||
defimpl Inspect, for: Aggregate do | ||
import Inspect.Algebra | ||
|
||
def inspect(%Aggregate{} = aggregate, opts) do | ||
%Aggregate{ | ||
aggregate_module: aggregate_module, | ||
aggregate_uuid: aggregate_uuid, | ||
aggregate_version: aggregate_version | ||
} = aggregate | ||
|
||
concat(["#", to_doc(aggregate_module, opts), "<#{aggregate_uuid}@#{aggregate_version}>"]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.