1

We are using NodeJs for a highly performant backend system and need to know most of the intricacies around JavaScript and how the NodeJs event loop works. One of our dependencies is the JavaScript Kafka client and as I went around digging through the codebase, I found this line of code that uses a:

while(true) {
}

This is effectively an infinite loop yet, the Kafka consumer does not seem to block the eventloop as other functions are being executed. How is NodeJs accomplishing this?

1
  • 1
    It has an await in it, so it's not blocking. Commented Dec 11, 2023 at 19:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.