asapScheduler not working as expected #6005
Unanswered
leebenmorris
asked this question in
Q&A
Replies: 1 comment 5 replies
-
asap scheduler explcitly states this: rxjs/src/internal/scheduler/asap.ts Lines 11 to 12 in 9acb950
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm doing some simple experiments with RxJS in a simple NodeJS Express server where I am comparing different approaches to handling and processing requests (based on this post https://snyk.io/blog/nodejs-how-even-quick-async-functions-can-block-the-event-loop-starve-io/). This is the basic setup:
It was my understanding that the
asapScheduler
would use setImmediate under the hood, so why does the/compute-immediate
endpoint NOT block the event loop (keeps the server responsive to new requests) but the/compute-rxjs
does block and leads to server timeouts on the health endpoint?I have also tried the
asyncScheduler
- this does not block, but it does take perhaps an order of magnitude longer to complete then the/compute-immediate
endpoint.I would really like to use RxJS for more complex processing of incoming requests, but feel this issue makes that choice undesirable. Is there something I am missing? Is there a way to get the RxJS solution to work in the same way as the setImmediate solution?
Beta Was this translation helpful? Give feedback.
All reactions