Jump to content

Manual:Domain events/Glossary

From mediawiki.org
DomainEvent An immutable value object that represents a change to something relevant to a specific domain (as in DDD).
emitter Generic term for any arbitrary code code that emits events via a DomainEventDispatcher (by calling its dispatch() method)
receiver Generic term for any arbitrary code that receives previously emitted events. This includes PHP listeners as well as non MediaWiki receivers.
listener A PHP function to be invoked for handling of an event
subscriber Generic term for any arbitrary code that registers a listener for an event via a DomainEventSource.  (NOTE: A DomainEventSubscriber is a related formal concept, described below.)
ingress An ingress object is an event subscriber that acts as an adapter for incoming events to a component (or service or extension). It is responsible for triggering the appropriate logic for a given event.
invoke Causing registered listeners to be called for an emitted event.
invocation mode When and how a listener is invoked. The invocation mode may be controlled by options provided when registering a listener with an event source. The default invocation mode is "deferred", that is, after the main transaction has succeeded.
in-process Refers to scenarios where a listener is invoked in the same PHP process as the event’s emitter.
cross-service Refers to scenarios where an event is received in a different application or service than the emitter. 

This might be in another MediaWiki process, or in a completely different service.

same wiki event As in “local wiki”.  

An event received in-process or cross-process, but for the same wiki and MediaWiki configuration context. Opposite of remote event.

E.g. An enwiki edit event being handled in a different PHP process than the edit HTTP request in another enwiki MediaWiki context is still a local event.

inter wiki event As in “remote” or “foreign” or “cross” or “inter” wiki.

An event received cross-process by MediaWiki in which the event’s emitter was a different wiki.

We prefer the term “inter” wiki as it is perspective independent.  

E.g. enwiki listening for wikidata events.

off wiki event An event received cross-process by MediaWiki in which the emitter was not a wiki, but the event was still about a wiki thing, like a page.

E.g. enwiki listening to PageRevertRiskScore change events emitted by LiftWing.

non wiki event An event that is not about a wiki thing, e.g. IpReputationChange.
remote event A remote originating on another wiki or service. Opposite of “same wiki event”.
broadcast Producing an event to an event bus so that it can be consumed cross-process.

Note that we are avoiding the term ‘publish’ here so as not to confuse this concept as the reciprocal of ‘subscribe’.  In MW DomainEvents terminology, a subscriber is specifically an implementation of DomainEventSubscriber in PHP.

event bus Infrastructure for cross-process communication based on passing events asynchronously according to the pub/sub paradigm.

See also: Event_Platform#Event_Platform_generic_concepts

stream A named channel to which events can be broadcast.  This is sometimes called a ‘topic’, ‘channel’, ‘queue’, etc.  

WMF Event Platform uses the term ‘stream’, so we will use that for Domain Events to avoid confusion.

DomainEventDispatcher Interface used by emitters to dispatch events.
DomainEventSource Interface used by consumers to register listeners for events
EventDispatchEngine MW Service object implementing DomainEventDispatcher and DomainEventSource.
  • emitters use this to dispatch events
  • subscribers use this to register listeners for events.
DomainEventSubscriber Interface that uses a DomainEventSource instance to automate registering multiple listeners.  
EventIngressBase Abstract implementation of DomainEventSubscriber that registers listeners based on a function naming convention