ChicagoBoss / tinymq

TinyMQ - a diminutive, in-memory message queue
MIT License
124 stars 43 forks source link

OTP-ify tinymq application. #3

Closed robertoaloi closed 12 years ago

robertoaloi commented 12 years ago

According to the current implementation, the controller acts as some sort of "supervisor" for the channel_sup. A channel_sup is created for each channel. Is this intentional? Wouldn't it make sense to have a sub-tree with one channel sup and several channel?

evanmiller commented 12 years ago

Thanks for the pull request! This looks good, so I'll merge it in.

What's wrong with one-to-one channel supervision? Are you worried about memory?

robertoaloi commented 12 years ago

Simply wondering why you need of a supervisor for each channel. Couldn't you have a unique supervisor monitoring multiple channels? That would make you spare a bunch of processes. I guess I'm thinking about a root supervisor having two children: the controller and a channel supervisor. The channel supervisor would be the simple_one_for_one, supervising multiple channels. Just an idea.

evanmiller commented 12 years ago

That makes sense to me, and seems to be a cleaner supervision design than what's currently implemented. I'll be happy to merge in a pull request with that change (if you get around to it).