dispatchAndAwait

open suspend override fun dispatchAndAwait(action: ModuleAction): DispatchResult(source)

Dispatch an action and wait for it to be processed. Returns a DispatchResult indicating whether the action was applied or blocked.

Use this when you need to know the outcome of the dispatch, for example:

  • When middleware might block the action (spam protection)

  • When you need to perform follow-up work only if the action was applied

Return

DispatchResult.Processed if action was applied, DispatchResult.Blocked if middleware blocked the action, DispatchResult.Error if processing failed

Parameters

action

The action to dispatch