<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>makura_a</author_name>
  <author_url>https://blog.hatena.ne.jp/makura_a/</author_url>
  <blog_title>Ornithopter@安眠枕</blog_title>
  <blog_url>https://makura-a.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>Rubyで子プロセス監視Ruby1.9系だと Process.spawnが一番簡単みたい。クローラーなんかだと、相手側のサーバーの都合とか、回線の都合とかで rescue書いておいてもエラー落ちしてたり。 なんで、もし終了してたら再度実行させるみたいなのを簡単に書いておきたかった。例えば以下のコードをクローラーとして（エラー落ちする可能性ありコードって事で） 2.times{ puts &quot;test&quot; sleep 1 } 監視コードはこんな感じで書いておけば、エラー落ちしても再起動かけれる ラクチンだー def foo return Process.spawn(&quot;ruby 2times.rb&quot;)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmakura-a.hatenadiary.org%2Fentry%2F20120103&quot; title=&quot;Rubyで子プロセス監視 - Ornithopter@安眠枕&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>2012-01-03 00:00:00</published>
  <title>Rubyで子プロセス監視</title>
  <type>rich</type>
  <url>https://makura-a.hatenadiary.org/entry/20120103</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
