Application code callbacks at regular intervals
Abstract:
A method may include obtaining, for a thread executing application code, a recurring task, a recurring interval, a previous callback time, a starting counter value, and a counter trigger, initializing a current counter value to the starting counter value, and performing checks in response to adjustments to the current counter value. Each check may determine whether the respective adjusted current counter value satisfies the counter trigger. The method may further include in response to a check determining that the adjusted current counter value satisfies the counter trigger, invoking a callback handler with a callback that performs the recurring task, and in response to an elapsed time exceeding the recurring interval, executing, by the callback handler, the callback. The elapsed time may be an amount of time elapsed between the previous callback time and the first invocation. The method may further include modifying the starting counter value using the elapsed time.
Public/Granted literature
Information query
Patent Agency Ranking
0/0