3 ms·
> If you're doing networking stuff, we've got EventMachine for doing event-driven architecture There's a big difference. EventMachine is an asynchronous librar
by tferris 14y ago
> If you're doing networking stuff, we've got EventMachine for doing event-driven architecture
There's a big difference. EventMachine is an asynchronous library built with Ruby. EventMachine has nothing to do with Rails apart from them both being written in the same language. Now, go and try use both EventMachine and Rails in one project: it's a nightmare because they both follow different design principles. If you want to do event-driven architecture with EventMachine you will miss an ecosystem because a) there is none like around Rails and b) you cannot use Rails' ecosystem. Compare this to Node's ecosystem of 8,000 packages which follow all the event-driven architecture.
> ... that's a heavily proven library in production.
Heavily? Source?
> Sinatra pioneered the microframework niche, and most microframeworks in other languages like node.js are almost a carbon copy.
You are right and Sinatra was groundbreaking. But what's the goal of a microframework if the underlying stack is too complex for easy deployment or breaks with every patchlevel?
- cmelbye 14y agoI'm not sure if you fully understand the subject matter in question. EventMachine powers Thin, which is one of the most popular app servers in the wild. It's extremely easy to hook into EventMachine in Rails, and I encourage you to give it a try if you haven't yet. Even if you're not using Thin, EM can run in a thread and you can use it alongside Rails. As for a source for the "heavy use in production" comment, I suppose I can't provide one off the top of my head. However, if you're a Rubyist you know how often Thin is used in production. For a while, it seemed like every deployment guide suggested the use of Thin cluster to run the app. I'm not sure how you reached the conclusion that Sinatra (and thus, Rack apps, including Rails, in general) is difficult to deploy. We have mod_rails which makes it as easy as setting the apache DocumentRoot to your app. If that's not your cup of tea, it's a simple command to start up a cluster of Thin or Unicorn processes, and it's a few lines of nginx configuration to proxy. Essentially identical to how one would deploy node.js or any web development platform in existence for that matter.