misk
misk copied to clipboard
RepeatedTaskQueue needs a fixedRateSchedule
RepeatedTaskQueue is Misk's take on AbstractScheduledService, but it doesn't have feature parity. It should support fixedRateSchedule(), where tasks are scheduled at that interval regardless of how long tasks are run, so that we do not miss a task due to a previous iteration taking too long.
@mightyguava should tasks be allowed to overlap? ex: fixedRate(1 second) but the task takes 3 seconds should they keep piling up?
Yup, that's the request.
If by “overlap” you mean execute concurrently, then no - that’s not how scheduleAtFxedRate works in java.util.concurrent (tasks in juc never execute concurrently) and doing so here would violate principle of least astonishment.
FWIW tasks have complete control over their execution schedule and can implement fixed rate schedules directly, so this is really a convenience method - we didn’t implement the convenience method because in practice fixed rate schedules tend to be uncommon and usually a bit dangerous.
Agreed, what I meant was that the tasks would queue up, but they would not be executing concurrently.