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

109
Vistas
RxJS timeout hangs on Node.js

I never user RxJS, but now I'm working on a project which uses it.

I apologize if my question is not so clear, please do not hesitate to request for clarifications/edits.

I have an Observable which (in case of no errors) resolves very fast, but there is a timeout just in case...

I noticed that my Node.js process does not exits untill the timeout is not expired...

If I comment out this piece of code:

observable.pipe(
    timeout(3* 60 * 1000),
    catchError(() => throwError(() => new Error("timeout")))
);

the Node.js process exits without any problem.

Is there some way to unref an RxJS timeout?

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

0

I tried out a very simple example based from RXJS doc:

import { of } from 'rxjs';
import { concatMap, timeout, catchError, delay } from 'rxjs/operators';

// simulate request
function makeRequest(timeToDelay) {
  return of('Request Complete!').pipe(delay(timeToDelay));
}

of(200)
  .pipe(
    concatMap(duration =>
      makeRequest(duration).pipe(
        timeout(10500),
        catchError(() => throwError(() => new Error("timeout")))
        //catchError(error => of(`Request timed out after: ${duration}`))
      )
    )
  )
  .subscribe(val => console.log(val));

I am on Window 10, on the task manager, the process appear and disappear without waiting the timeout (10500ms).

However, when closing git bash I have:

error

But only if I launched my process like that node index.js & (& at the end to disconnect from terminal).

Unsure what the implications of the terminal telling me the process is still running, when the task manager says there is no running node process.

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