RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

Sinatra gone async with em-fiber_pool and em_mysql2.

Meet em-shorty, a modern URL shortener. This Sinatra app is completely async by using rack-fiber_pool and em_mysql2. If you have been curious about how async Sinatra works, this is a good sample to get you started. It's even setup with sinatra-activerecord so you have standard migrations and several database connectors to choose from.

There is a full API. It's easy to create or query urls in XML/JSON/YAML. Lots of things were done to add polish, including localization, less support for stylesheets, Bundler and RVM to make installation a breeze, and of course a thorough test suite. The code is at http://github.com/zquestz/em-shorty. Clipboard support is provided by ZeroClipboard. BTW, the screencast that started this little project deserves some credit.

Comments

Wow, someone rewrote my text in a big way... wasn't expecting that.zquestz - April 07, 2011 05:35
I edited it (capitalization, punctuation, added a couple of links to things you mentioned) and changed the spacing but I didn't rewrite it.

Why? Because it was taking up too much space on the front page. If you look at the other posts there, most of them are short, tight, single paragraph pages. You can then put "extra" stuff in to the comments section. I run a tight front page ;-)

This is covered in point 4 when you post: Unless necessary, post in a single paragraph. Your post may be edited to rectify this. So.. I did ;-)

Nonetheless, good post.PeterCooper - April 07, 2011 05:58
I don't think he said that in a negative way. :)nikolay - April 07, 2011 06:01
Yeah I am fine with it, was just surprised when I refreshed the page. Honestly as long as people check it out on github I don't care how it's formatted. =)zquestz - April 07, 2011 06:02
Great example, thanks ! I felt surprised that you don't use async_sinatra at first glance, but using rack fiber pool looks very straight forward. will look into it deeper to understand really how it works async.EppO - April 07, 2011 14:30
When it became clear Coach Factory Online about midnight that President Barack Obama was safely on Louis Vuitton Belt the way to re-election, a handful of cranky and Coach Outlet Store inebriated Republican donors wandered about Gucci Belt Romney's election night headquarters, angrily demanding that the Coach Factory Outlet Online giant television screens inside the ballroom be switched from CNN Coach Factory Store to Fox News, where Republican strategist Karl Rove was Coach Factory Online making frantic, face-saving pronouncements about Coach Factory Outlet how Ohio was not yet lost.But the signs of Coach Outlet Online desperation inside the Boston Convention and Coach Bags Outlet Exhibition Center on Tuesday night were symptomatic of a Republican Party Coach Factory Online now standing at a crossroads, with not much track in sight.Romney lost Coach Factory Outlet Online embarrassingly among young people, African-Americans and Hispanics, a brutal Coach Outlet Online reminder for Republicans that their party is ideologically out of tune with Coach Factory Outlet fast-growing segments of the population.Obama crushed Romney among Hispanic Hermes Belt voters by a whopping 44 points, a margin of victory that Coach Factory Online likely propelled the president to victories in Nevada, Colorado and possibly Florida.yaya - November 09, 2012 01:22

Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!