Skip to content

Repeat scheduled task specific number of times #49

Answered by davetcc
ekainz asked this question in Q&A
Discussion options

You must be logged in to vote

Here's the common pattern for that case, its used quite a bit in TcMenu and elsewhere:

// somewhere in your code
taskManager.execute(taskManagerFn);

// and the function looks like
void taskManagerFn() {
     // do some work

    if(stillNeedToScheduleAgain) {
        taskManager.scheduleOnce(interval, taskManagerFn);
    }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@davetcc
Comment options

Answer selected by ekainz
@davetcc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants