I’m just looking at DiscourseEvent and I want to make sure I understand how it works.
It looks like a very simple in-memory hash, and for a given key (which is an specific event), it takes an array of functions to call.
I can’t seem to find where an event gets consumed in the codebase, or where a function is added to the array of functions to call when the event fires. Can someone point me to an example?
Was this created for internal use or is this just for plugins?
Example, when a post gets approved or disapproved, lots of things happen under the covers. Is this event used internally for things like this?
Say my discourse install gets shutdown and exactly when it was being shutdown, it was in a middle of a transaction or it was doing a series of tasks that is now broken mid-way. Is there a way to re-calculate everything to fix what might be half-baked/broken?