Package com.velocitypowered.api.event
Interface AwaitingEventExecutor<E>
- Type Parameters:
E- event type
- All Superinterfaces:
EventHandler<E>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An event handler that returns an
EventTask to await on.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidThis method is not supported forAwaitingEventExecutorand will throw an exception if invoked.@Nullable EventTaskexecuteAsync(E event) Executes the event handler asynchronously.
-
Method Details
-
execute
This method is not supported forAwaitingEventExecutorand will throw an exception if invoked. UseexecuteAsync(Object)instead.- Specified by:
executein interfaceEventHandler<E>- Parameters:
event- the event to handle- Throws:
UnsupportedOperationException- always
-
executeAsync
Executes the event handler asynchronously.Returns an
EventTaskthat the event bus will await before continuing. May returnnullto indicate no asynchronous task should be awaited.- Specified by:
executeAsyncin interfaceEventHandler<E>- Parameters:
event- the event to handle- Returns:
- an
EventTaskto await, ornullif none
-