I chose Ruby for a side project some time ago, and used Thin as my primary server. At the time EventMachine and "evented web-server" didn't mean much to me so I ignored it - I just knew Thin was fast
Recently I've come back to understand these terms and have realized I've written my server code completely wrong. I have many blocking operations such as calls to the database, calls to redis, calls the third party API's all of which must be blocking the single reactor thread in EventMachine. None of the drivers I'm using have support enabled for EventMachine.
It seems that I have two options at the moment
I've noticed that thin provides a --threaded
option as well, so perhaps this is a good short-term solution, since theoretically any blocking network calls will only affect that particular thread, and not the threads of other requests. Is this correct?
As a side question, does Thin benefit from using a threaded mode, as well as using non-blocking calls in each thread? Can I still use database drivers designed for EventMachine in this threaded mode, and is there an advantage for doing so?
--
You received this message because you are subscribed to the Google Groups "thin-ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thin-ruby+...@googlegroups.com.
To post to this group, send email to thin...@googlegroups.com.
Visit this group at http://groups.google.com/group/thin-ruby.
For more options, visit https://groups.google.com/d/optout.