MessageFunctionRegistrar

Registry for message functions that can be registered and queried.

This interface provides a centralized mechanism for managing message functions within the Wow framework. It allows registration and unregistration of functions, as well as querying for functions that can process specific messages. The registry supports filtering to create scoped registrars for specific use cases.

Example usage:

val registrar = MessageFunctionRegistrar<MyMessageFunction>()
val myFunction = MyMessageFunction()
registrar.register(myFunction)

val message = MyMessage()
val supported = registrar.supportedFunctions(message)
supported.forEach { it.process(message) }

Parameters

F

The type of message function being registered, constrained to implement MessageFunction<*, *, *>

See also

for the base interface of message functions

Inheritors

Properties

Link copied to clipboard
abstract val functions: Set<F>

The immutable set of all currently registered functions.

Functions

Link copied to clipboard
abstract fun filter(predicate: (F) -> Boolean): MessageFunctionRegistrar<F>

Creates a filtered view of this registrar.

Link copied to clipboard
abstract fun register(function: F)

Registers a message function with this registrar.

Link copied to clipboard

Finds all registered functions that support processing the given message.

Link copied to clipboard
abstract fun unregister(function: F)

Unregisters a message function from this registrar.