Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support intervals with Wing #7090

Open
boyney123 opened this issue Sep 9, 2024 · 3 comments
Open

Support intervals with Wing #7090

boyney123 opened this issue Sep 9, 2024 · 3 comments
Labels
🛠️ compiler Compiler ✨ enhancement New feature or request good first issue Good for newcomers

Comments

@boyney123
Copy link
Contributor

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

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Discord.
@boyney123 boyney123 added ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl 🛠️ compiler Compiler labels Sep 9, 2024
@monadabot monadabot added this to Wing Sep 9, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Sep 9, 2024
@Chriscbr
Copy link
Contributor

Chriscbr commented Sep 9, 2024

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.

@Chriscbr Chriscbr added good first issue Good for newcomers and removed needs-discussion Further discussion is needed prior to impl labels Sep 9, 2024
@Pushkarm029
Copy link
Contributor

I can help with this issue.

@Pushkarm029
Copy link
Contributor

Working on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️ compiler Compiler ✨ enhancement New feature or request good first issue Good for newcomers
Projects
Status: 🆕 New - not properly defined
Development

No branches or pull requests

3 participants