开发者

Erlang process queues best practices?

开发者 https://www.devze.com 2023-03-21 02:51 出处:网络
I\'ve built a proce开发者_Python百科ss queue implementation that creates a pool of worker processes that receive a payload message with the datum to work on. When that process is done, it sends a mess

I've built a proce开发者_Python百科ss queue implementation that creates a pool of worker processes that receive a payload message with the datum to work on. When that process is done, it sends a message back to the pool and the pool manager re-enqueues that process ID for use.

My question is this: is it better to discard the process and just spawn a new one? Or recycle it?


Process construction in Erlang is extremely lightweight. Discard and create a new one.

0

精彩评论

暂无评论...
验证码 换一张
取 消