Answer the question
In order to leave comments, you need to log in
Why does thread block execution?
here is a code snippet. with multiple parallel requests, they are executed alternately every 5 seconds
@Controller('request')
export class HOController {
constructor() {}
@SkipAuth()
@All('/')
@UseGuards(ApiKeyGuard)
async index(@Request() req, @Res() res) {
console.log('--- REQUEST RECEIVED ---');
await new Promise((res) => setTimeout(res, 5000));
console.log('TIMEOUT END');
res.end();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question