Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda