最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - How to make worker_threads in an express app deal with request and response object? - Stack Overflow

programmeradmin3浏览0评论

I want to make worker_threads in an express app deal with request and response object so that the main thread of the process is free to accept the next incoming request. I know clustering is a way where processes are dealing with the request. But I want to know specifically about the worker_threads if this is possible, so that even one process can accommodate even more requests and work independently with the worker_thread.

I want something like threads must work independently dealing the request and response object (definitely req and res object must not be in transferlist and only be sent a structured clone version so that req and res object is still available to the process) while the express instance is free for accepting next request and again create another worker_thread for that and as many as this operation keeps on going.

Might be multiple threads above the limit of a core supports is useless to create but I do not want to focus that condition right now.

发布评论

评论列表(0)

  1. 暂无评论