EventProcessor.emitProtocol

Calls all protocol methods in ExtensionModule matching a certain method and method type.

mixintemplate EventProcessor(alias ExtensionModule, EventProcessorConfig config = EventProcessorConfig.init)
bool
emitProtocol
(
alias UDA
alias callback
bool returnFirst
Args...
)
(
string method
,
string params
,)

Parameters

UDA

The UDA to filter the methods with. This must define a string member called method which is compared with the runtime method argument.

callback

The callback which is called for every matching function with the given UDA and method name. Called with arguments `(string name, void delegate() callSymbol, UDA uda) where the callSymbol` function is a parameterless function which automatically converts the JSON params and additional available arguments based on the method overload and calls it.

returnFirst

If true the callback will be called at most once with any unspecified matching method. If false the callback will be called with all matching methods.

method string

the runtime method name to compare the UDA names with

params string

the JSON arguments for this protocol event, automatically converted to method arguments on demand.

availableExtraArgs Args

static extra arguments available to pass to the method calls. out, ref and lazy are perserved given the method overloads. overloads may consume anywhere between 0 to Args.length of these arguments.

Return Value

Type: bool

true if any method has been called, false otherwise.

Meta