Run Ruby thread for Slack bot on only one Unicorn worker
<p>I created a slack bot and run it like so in a rails initializer:</p>

<pre><code>Thread.abort_on_exception = true

Thread.new do
  CorgiBot.run
end
</code></pre>

<p>I run Unicorn with multiple workers though, so each worker runs the Slack bot. What happens then is that each worker has the same slack bot running on it and so returns multiple responses/messages inside of slack for each command it receives.</p>

<p>I'm trying to avoid running the slack bot on its own server for various reasons. Any ideas for solutions to this using Unicorn or just changing my setup in on Ruby or Rails?</p>