Interface ExpirationStrategy
- All Known Implementing Classes:
ExpirationStrategy.Explicit
,ExpirationStrategy.Inactivity
public sealed interface ExpirationStrategy
permits ExpirationStrategy.Inactivity, ExpirationStrategy.Explicit
Classes implementing ExpirationStrategy
define a strategy when a Runtime
should be closed.
There are two strategies available:
ExpirationStrategy.Inactivity
: closes aRuntime
after the passed amount of timeExpirationStrategy.Explicit
: Only closes a runtime whenEvent.closeRuntime()
is called.
- Implementation Note:
- The
ExpirationStrategy.Inactivity
strategy will check all activeRuntimes
at every incoming jda event. If aRuntime
didn't handle any events in the last x minutes, it will be closed.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
static final record
ExpirationStrategy
that closes aRuntime
after the passed amount of time. -
Field Summary
Modifier and TypeFieldDescriptionstatic final ExpirationStrategy
DefaultExpirationStrategy
ofExpirationStrategy.Inactivity
, that closesRuntimes
after 15 minutes of inactivity.static final ExpirationStrategy
DefaultExpirationStrategy
ofExpirationStrategy.Explicit
.
-
Field Details
-
AFTER_15_MINUTES
DefaultExpirationStrategy
ofExpirationStrategy.Inactivity
, that closesRuntimes
after 15 minutes of inactivity. -
EXPLICIT
DefaultExpirationStrategy
ofExpirationStrategy.Explicit
.
-