Erlang process queues best practices?
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.
精彩评论