Hi Daniel,
I was checking this article quickly
https://www.mediawiki.org/wiki/Manual:Domain_events/Report_FY24-25
and it's great (particularly the idea to identify some hooks as "events")
however I would be interested in the following clarifications:
1) here "Hooks are typically, but not always, invoked synchronously during the
main transaction, while the client waits for a response." -- shouldn't be
rather "while the caller waits" or "where the caller waits" instead of "while
the client waits" if with "client" you mean the hook dispatcher ?
2) here "Events get delivered to listeners via a DeferredUpdate after the main
transaction was successful and the response has been sent to the client. This
clarifies the semantics of extension callbacks invoked as a result of a change,
particularly with respect to transactional context."
do you mean that in case of events the hook handlers cannot anymore modify the
source data before are saved, if that's needed for any reason ? Can you also
clarify more the second part of the paragraph ?
thanks a lot
(Thomas)
---- On Tue, 15 Jul 2025 11:45:55 +0100 Daniel Kinzler <[email protected]>
wrote ---
TLDR: https://www.mediawiki.org/wiki/Manual:Domain_events .
Over the course of the fiscal year the MediaWiki Interfaces team has introduced
a system of Domain Events into MediaWiki. Domain Events provide a new way for
extensions and core components to be notified about changes in other parts of
the system, offering a more expressive and sustainable alternative to hooks
that were previously used for this purpose. The need for this new capability
was identified by a survey of hook usage we conducted in the first quarter.
The work on the domain events system was conducted in close collaboration with
Data Platform Engineering with substantial support from the Growth team and the
Language team. These collaborations have proven immensely valuable by allowing
us to iterate on the design early on and fostered knowledge sharing across the
teams.
Our efforts have resulted in a simple yet powerful system that has already
proven effective in avoiding coupling between core components and reducing the
need for boiler plate code in extensions. The domain events framework itself is
part of the MediaWiki 1.44 release, but the event classes themselves are still
experimental. A set of events representing changes to pages is scheduled to
become part of MediaWiki’s stable interface in 1.45.
In the future, domain events will hopefully help to integrate MediaWiki into an
event-based architecture that enables data-backed features: generalizing the
mechanism for broadcasting events via Kafka that is currently implemented in
EventBus would make it much easier to inform other processes about state
changes in MediaWiki. But there is even more potential in providing a simple
mechanism for MediaWiki to receive events from other services.
If you want to know more about the architecture of the event dispatcher, the
modeling of page changes as events, or about what we hope to do with domain
events in the future, have a look at the
https://www.mediawiki.org/wiki/Manual:Domain_events/Report_FY24-25 . If you
want to dive right in, best follow
https://www.mediawiki.org/wiki/Manual:Domain_events .
I'm very happy and proud of what we have achieved. I hope you like it too!
_______________________________________________
Wikitech-l mailing list -- mailto:[email protected]
To unsubscribe send an email to mailto:[email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
_______________________________________________
Wikitech-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/