Changed signatures of Scheduler for better api of by-name blocks

This commit is contained in:
Patrik Nordwall 2011-12-02 17:13:46 +01:00
parent af1ee4fb5a
commit 1f665ab4c6
10 changed files with 57 additions and 50 deletions

View file

@ -136,7 +136,7 @@ abstract class MessageDispatcher(val prerequisites: DispatcherPrerequisites) ext
shutdownScheduleUpdater.get(this) match {
case UNSCHEDULED
if (shutdownScheduleUpdater.compareAndSet(this, UNSCHEDULED, SCHEDULED)) {
scheduler.scheduleOnce(shutdownAction, shutdownTimeout)
scheduler.scheduleOnce(shutdownTimeout, shutdownAction)
()
} else ifSensibleToDoSoThenScheduleShutdown()
case SCHEDULED
@ -211,7 +211,7 @@ abstract class MessageDispatcher(val prerequisites: DispatcherPrerequisites) ext
}
case RESCHEDULED
if (shutdownScheduleUpdater.compareAndSet(MessageDispatcher.this, RESCHEDULED, SCHEDULED))
scheduler.scheduleOnce(this, shutdownTimeout)
scheduler.scheduleOnce(shutdownTimeout, this)
else run()
}
}