postAsync

abstract fun <T : Event> postAsync(event: T): CompletableFuture<T>

Dispatches event asynchronously and returns a CompletableFuture that completes with the event once all handlers have finished.

Handlers execute in the same priority order as post. Async handlers are submitted to the bus's executor; sync handlers that follow an async one are chained after it completes so they always observe mutations from higher-priority async handlers.

Handler exceptions are routed to exceptionHandler; the future never completes exceptionally due to handler errors. The future only completes exceptionally on infrastructure failure (e.g. executor rejection). This is intentionally asymmetric with post, which routes infrastructure failures to exceptionHandler to preserve its no-throw contract.

If no executor is configured, all handlers run synchronously on the calling thread and the returned future is already completed on return.

For Cancellable events, cancellation is automatically thread-safe across async handlers.

Return

a CompletableFuture completing with event after all handlers finish.