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

107
Views
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 answers
Answer question

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 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!