mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
chore(ActionScheduler): remove todos
This commit is contained in:
@@ -59,7 +59,6 @@ class ActionScheduler : AgentRunningSubModule<Set<Schedulable>, Void>() {
|
|||||||
.collect(Collectors.toSet())
|
.collect(Collectors.toSet())
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 3. 重构 trigger 内容,在替换为 Set<Schedulable> 后,需要进行类型判定,确认是自行执行,还是交给 actionExecutor
|
|
||||||
val onTrigger: (Set<Schedulable>) -> Unit = { schedulableSet ->
|
val onTrigger: (Set<Schedulable>) -> Unit = { schedulableSet ->
|
||||||
val executableActions = mutableSetOf<SchedulableExecutableAction>()
|
val executableActions = mutableSetOf<SchedulableExecutableAction>()
|
||||||
val stateActions = mutableSetOf<StateAction>()
|
val stateActions = mutableSetOf<StateAction>()
|
||||||
@@ -90,7 +89,6 @@ class ActionScheduler : AgentRunningSubModule<Set<Schedulable>, Void>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun execute(schedulableSet: Set<Schedulable>?): Void? {
|
override fun execute(schedulableSet: Set<Schedulable>?): Void? {
|
||||||
// TODO 1. 将输入参数重构为 Set<Schedulable>,在 for 循环中依据计划字段放入时间轮
|
|
||||||
schedulerScope.launch {
|
schedulerScope.launch {
|
||||||
schedulableSet?.run {
|
schedulableSet?.run {
|
||||||
for (schedulableData in schedulableSet) {
|
for (schedulableData in schedulableSet) {
|
||||||
@@ -105,7 +103,6 @@ class ActionScheduler : AgentRunningSubModule<Set<Schedulable>, Void>() {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 2. 重构为 Set<Schedulable>
|
|
||||||
private class TimeWheel(
|
private class TimeWheel(
|
||||||
val listSource: () -> Set<Schedulable>,
|
val listSource: () -> Set<Schedulable>,
|
||||||
val onTrigger: (toTrigger: Set<Schedulable>) -> Unit
|
val onTrigger: (toTrigger: Set<Schedulable>) -> Unit
|
||||||
|
|||||||
Reference in New Issue
Block a user