{"id":6923,"date":"2013-01-08T14:31:22","date_gmt":"2013-01-08T20:31:22","guid":{"rendered":"http:\/\/bobbeaty.com\/wp\/?p=6923"},"modified":"2013-01-08T16:40:11","modified_gmt":"2013-01-08T22:40:11","slug":"trying-to-get-keep-alives-in-unicorn","status":"publish","type":"post","link":"https:\/\/bobbeaty.com\/wp\/archives\/6923","title":{"rendered":"Trying to Get Keep-Alives in Unicorn"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bobbeaty.com\/wp\/wp-content\/uploads\/2012\/07\/Ruby.jpg\" alt=\"Ruby\" title=\"Ruby.jpg\" border=\"0\" width=\"90\" height=\"90\" style=\"float:right; margin-left:10px;\" \/><\/p>\n<p>Today I <em>struggled<\/em> trying to get the <a href=\"http:\/\/bobbeaty.com\/wp\/2013\/01\/6922\/\">same<\/a> keep-alive going in out production server, but because it's running Unicorn and not Thin, and Unicorn is <strong><em>not<\/em><\/strong> an event-driven server, it was a lot harder. To be fair, a lot of this had to do with the problems I was having with the deployment of software to the boxes. The Shop has a lot of progressive tools, but the deployment of packages is <strong><em>not<\/em><\/strong> among them. So there were several hours lost there.<\/p>\n<p>But the real problem was figuring out how to integrate an EventMachine into the Unicorn server. Thankfully, I was able to find a simple way to do it:<\/p>\n<pre class=\"ruby\" style=\"font-family:monospace;\">  <span style=\"color:#CC00FF; font-weight:bold;\">Thread<\/span>.<span style=\"color:#9900CC;\">new<\/span> <span style=\"color:#006600; font-weight:bold;\">&#123;<\/span> EventMachine.<span style=\"color:#9900CC;\">run<\/span> <span style=\"color:#006600; font-weight:bold;\">&#125;<\/span><\/pre>\n<p>So simple, but so <em>completely<\/em> non-obvious.<\/p>\n<p>With that, it started working and I just continued to struggle with the fact that Unicorn doesn't expose a logger like Sinatra\/Thin.<\/p>\n<p>These are not the easy tools that folks make them out to be.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I struggled trying to get the same keep-alive going in out production server, but because it&#8217;s running Unicorn and not Thin, and Unicorn is not an event-driven server, it was a lot harder. To be fair, a lot of this had to do with the problems I was having with the deployment of software [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6,4],"tags":[],"class_list":["post-6923","post","type-post","status-publish","format-standard","hentry","category-coding","category-cube-life","category-open-source-software"],"_links":{"self":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/6923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/comments?post=6923"}],"version-history":[{"count":0,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/6923\/revisions"}],"wp:attachment":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/media?parent=6923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/categories?post=6923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/tags?post=6923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}