diff --git a/Partner-Core/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt b/Partner-Core/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt index 39a93a03..650ab5e5 100644 --- a/Partner-Core/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt +++ b/Partner-Core/src/main/java/work/slhaf/partner/module/modules/action/dispatcher/scheduler/ActionScheduler.kt @@ -29,7 +29,7 @@ import java.time.temporal.ChronoUnit import java.util.stream.Collectors import kotlin.jvm.optionals.getOrNull -class ActionScheduler : AbstractAgentModule.Sub, Void?>() { +class ActionScheduler : AbstractAgentModule.Standalone() { @InjectCapability private lateinit var actionCapability: ActionCapability @@ -79,17 +79,14 @@ class ActionScheduler : AbstractAgentModule.Sub, Void?>() { }) } - override fun execute(input: Set): Void? { - schedulerScope.launch { - for (schedulableData in input) { - log.debug("New data to schedule: {}", schedulableData) - timeWheel.schedule(schedulableData) - if (schedulableData is SchedulableExecutableAction) { - actionCapability.putAction(schedulableData) - } + fun execute(input: Set) = schedulerScope.launch { + for (schedulableData in input) { + log.debug("New data to schedule: {}", schedulableData) + timeWheel.schedule(schedulableData) + if (schedulableData is SchedulableExecutableAction) { + actionCapability.putAction(schedulableData) } } - return null } private class TimeWheel(