adinapoli / threads-supervisor

Simple, IO-based Haskell library for Erlang-inspired thread supervisors
MIT License
29 stars 4 forks source link

Remove SupervisionSpec #20

Closed adinapoli closed 8 years ago

adinapoli commented 8 years ago

Hey @srijs ,

just a quick heads-up that I'm about to push and merge a medium-sized PR which removes entirely the need for a SupervisionSpec. The more I program in Haskell the more I appreciate the value and solidity of simple abstractions. The SupervisionSpec was since the beginning a bit of a smelly data structure, and I have later realised it's actually very dangerous to use! Due to the fact users of the library can create multiple Supervisor(s) from the same spec, and due to the fact newSupervisor actually dupChan the eventStream, you can get into weird situation, especially regarding monitoring supervisors, which I have successfully implemented in this upcoming patch.

I hope this won't make you too grumpy, but it was necessary to make this library really useful!

adinapoli commented 8 years ago

Fixed by https://github.com/adinapoli/threads-supervisor/pull/21

srijs commented 8 years ago

I like it! I actually had the same concerns, but hadn't figured out yet how to best solve it. Glad you were able to come up with this.