admin管理员组文章数量:1245106
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.
版权声明:本文标题:node.js - How to make worker_threads in an express app deal with request and response object? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740207009a2241284.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论