如何在预定时间调用SBT任务?

时间:2022-02-21 02:32:11

When providing a setting value:

提供设定值时:

mySetting := {
   new Thread() {
       override def run() = {
             Thread.sleep(1000)
             // Need to call a task from here
             myTask.value
       }
   }
   "some value"
}

I need to call a task after some time. Of course, in my real scenario, it is something more complex than a simple delay.

我需要在一段时间后调用一个任务。当然,在我的实际场景中,它比简单的延迟更复杂。

I cannot use myTask.value because it would perform the task at the wrong time.

我不能使用myTask.value,因为它会在错误的时间执行任务。

How can I call a task when I wish to?

我希望如何调用任务?

1 个解决方案

#1


The solution is to call the implementation of the task.

解决方案是调用任务的实现。

But SBT, isn't aware that the originating task hasn't ended yet, even though it is scheduled for later the 2nd task.

但是SBT并没有意识到原始任务还没有结束,即使它计划在第二个任务之后。

#1


The solution is to call the implementation of the task.

解决方案是调用任务的实现。

But SBT, isn't aware that the originating task hasn't ended yet, even though it is scheduled for later the 2nd task.

但是SBT并没有意识到原始任务还没有结束,即使它计划在第二个任务之后。