Events #8
matt-beanland
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We want to extend diffo so that Instances can fire service or resource events, as per TMF638, TMF639.
These events could be resources/nodes, and could be 'has_many' with the instance, however we'd like to avoid a future 'dense node' problem by chaining events, such that the 'tail' extends away from the instance, i.e. we insert a new event at the head of the chain. This pattern make is easy (via CQL, perhaps not so much by Ash) to read the last n events by simple traversal, and to prune/archive historic events. The event must contain a JSON serialised version of itself.
Actions which transition the service state should create an event, and this should be transactional, such as the event is only send 'on the wire' if the transaction is committed. Another process should ensure committed events are sent, perhaps by maintaining a queue of unsent events.
We will also want to be able to support events for other TMF things that aren't service or resource instances.
(:Instance) -[FIRED]->(:Event) -[AFTER]->(:Event)
There is an ash_events extension, which is more about event sourcing, although events are 2nd order in ash over resource state: https://alembic.com.au/blog/ash-events-event-sourcing-made-simple-for-ash-framework
ash_events can persist events in a separate datalayer, but I don't want to lose context between the resource firing the event and the event itself.
Beta Was this translation helpful? Give feedback.
All reactions