Package com.mrivanplays.jdcf.util
Class EventWaiter
- java.lang.Object
-
- com.mrivanplays.jdcf.util.EventWaiter
-
- All Implemented Interfaces:
net.dv8tion.jda.api.hooks.EventListener
public class EventWaiter extends java.lang.Object implements net.dv8tion.jda.api.hooks.EventListener
Took from JDA utilities in order to fix some concurrency issues
-
-
Constructor Summary
Constructors Constructor Description EventWaiter(java.util.concurrent.ScheduledExecutorService threadpool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onEvent(net.dv8tion.jda.api.events.GenericEvent event)
<T extends net.dv8tion.jda.api.events.Event>
voidwaitForEvent(java.lang.Class<T> classType, java.util.function.Predicate<T> condition, java.util.function.Consumer<T> action, java.lang.Runnable timeoutAction)
-
-
-
Method Detail
-
waitForEvent
public <T extends net.dv8tion.jda.api.events.Event> void waitForEvent(java.lang.Class<T> classType, java.util.function.Predicate<T> condition, java.util.function.Consumer<T> action, java.lang.Runnable timeoutAction)
-
onEvent
public final void onEvent(net.dv8tion.jda.api.events.GenericEvent event)
- Specified by:
onEvent
in interfacenet.dv8tion.jda.api.hooks.EventListener
-
-