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

200
Vistas
node.js : How to combine a server that does post requests on a timed basis, with a server which listens for events

So I am working on a project where there is a program like the following:

async function watch(){
    "does post requests"
}
async function timer() {
    await watch();
};
let tmr = setInterval(function(){ timer() }, 6 * 1000);

async function main() {
   "does event listening"
}
main()

and it is very clunky.

I am wondering if there are any node wizards here that can help with this sort of architecture problem?

I.e. How to combine a server that does post requests on a timed basis, with a server which listens for events.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

What might interest you is: https://www.npmjs.com/package/node-cron

You could simply create the http server and declare routes to receive requests, and configure node cron-job that will send requests of your choice on a timed basis.

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