Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Wait for previous execution before running next one?

I have long-running function that can be called several times in short period of time. I dont realy need to await her, so I want following: If previous instance of function is still running, next runs should wait for previous one to finish.

Simplest/correct way to solve?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I have created a tiny package called mutually-exclusive-functions that is capable of doing what you want.

const { exclude } = require("mutually-exclusive-functions");

async function f1() {};

[f1] = exclude([f1]);

Now if you execute f1, it will queue further calls and only execute them after the previous calls have finished execution.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!