Class AudioPlayerLifecycleManager
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.player.AudioPlayerLifecycleManager
-
- All Implemented Interfaces:
AudioEventListener,java.lang.Runnable
public class AudioPlayerLifecycleManager extends java.lang.Object implements java.lang.Runnable, AudioEventListener
Triggers cleanup checks on all active audio players at a fixed interval.
-
-
Constructor Summary
Constructors Constructor Description AudioPlayerLifecycleManager(java.util.concurrent.ScheduledExecutorService scheduler, java.util.concurrent.atomic.AtomicLong cleanupThreshold)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialise()Initialise the scheduled task.voidonEvent(AudioEvent event)voidrun()voidshutdown()Stop the scheduled task.
-
-
-
Constructor Detail
-
AudioPlayerLifecycleManager
public AudioPlayerLifecycleManager(java.util.concurrent.ScheduledExecutorService scheduler, java.util.concurrent.atomic.AtomicLong cleanupThreshold)- Parameters:
scheduler- Scheduler to use for the cleanup check taskcleanupThreshold- Threshold for player cleanup
-
-
Method Detail
-
initialise
public void initialise()
Initialise the scheduled task.
-
shutdown
public void shutdown()
Stop the scheduled task.
-
onEvent
public void onEvent(AudioEvent event)
- Specified by:
onEventin interfaceAudioEventListener- Parameters:
event- The event
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
-