Open boyney123 opened 2 months ago
A way to create timers or ticker would be great to have for inflight code. We can start by porting JavaScript's built-in APIs straight over for initial support:
inflight () => {
let id: num = util.setInterval(func, 5s); // run "func" every 5s
// ...
util.clearInterval(id); // stop the timer
};
Adding this as a good first issue.
Only inflight support I imagine?
Yeah, I think so.
I can help with this issue.
Use Case
I'm trying to understand if I can use intervals with Wing, other programming languages have them
For example: A as a developer writing containerised code, maybe I want to setup an interval to hit an endpoint every X seconds
Proposed Solution
Maybe
util.setInterval(func, duration)
would work? Or something similar?Only inflight support I imagine?
Implementation Notes
No response
Component
No response
Community Notes