An event-architecture extension for Ash (not ready for production use).
Find a file
2024-06-18 21:39:26 -04:00
.github chore: enable dependabot for mix dependencies. 2024-04-11 09:49:55 +12:00
config improvement!: update to Ash 3.0 2024-04-03 12:44:00 -04:00
lib Update persist_event.ex 2024-06-18 21:39:26 -04:00
test improvement!: update to Ash 3.0 2024-04-03 12:44:00 -04:00
.formatter.exs WIP 2023-09-29 15:38:27 -04:00
.gitignore chore: add some docs and rename things 2023-09-29 15:56:12 -04:00
mix.exs improvement!: update to Ash 3.0 2024-04-03 12:44:00 -04:00
mix.lock improvement!: update to Ash 3.0 2024-04-03 12:44:00 -04:00
README.md chore: add some docs and rename things 2023-09-29 15:56:12 -04:00

AshEvents

A fledgeling Ash extension for transforming Ash resources to use an event oriented architecture. This is still an experiment, it only supports create actions (but could be made to support updates and destroys without much trouble).

Caveats:

  • We aren't storing the actor in any way. We would need to store actor information to perform authorization.
  • the event_driven version is not really distinguishable from ash_paper_trail except that it has fewer features and writes to a single events resource.
  • if you want to use this, you would have to do work to get it ready for your cases.

Configure the style using the style option, for example:

events do
  style :event_sourced
end

The default is :event_driven, and generally means there is nothing to do except integrate this extension.

Event Driven

Event driven architecture is relatively simple. We encode the inputs to the action into an event and commit that event alongside the performance of the action, transactionally.

Event Sourced

With event sourced, things change quite a bit. Instead of storing the event and performing the action, we only store the event, and it is your responsibility to take each event, perform the action it refers to and mark it as processed, in whatever way you see fit.