<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>jiikko</author_name>
  <author_url>https://blog.hatena.ne.jp/jiikko/</author_url>
  <blog_title>ツユダクの肉増しのRuby on Railsの初心者で</blog_title>
  <blog_url>https://jiikko.hatenadiary.org/</blog_url>
  <categories>
    <anon>Rails</anon>
  </categories>
  <description>RailsでThread使う機会がないと思っていたけどあった。controllerで複数のサーバへGetリクエストを送信する、という処理を書きたかった。 そのまま書けば、レスポンスが帰ってこないと次のリクエストを投げれないのでとてもパフォーマンスが悪い。 それでThread使ってみた。 def index threads = [] Connection.all.each do |connection| threads &lt;&lt; Thread.new do ActiveRecord::Base.connection_pool.with_connection do connection.health_…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjiikko.hatenadiary.org%2Fentry%2F20130812%2F1376311918&quot; title=&quot;Threadを使う - ツユダクの肉増しのRuby on Railsの初心者で&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-08-12 21:51:58</published>
  <title>Threadを使う</title>
  <type>rich</type>
  <url>https://jiikko.hatenadiary.org/entry/20130812/1376311918</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
