Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Fault Tolerance

//de edited this page Dec 12, 2013 · 4 revisions

NOTE: due to a bug, Reel does not reboot properly on OS X on a crash

Celluloid includes a supervision framework for automatically restarting actors that crash.

To use this feature, we call the #supervise method on Reel::Server. This method comes from Celluloid and is available on all Celluloid actors (including subclasses of Reel::Server):

require 'reel'

supervisor = Reel::Server::HTTP.supervise('127.0.0.1', 3000) do |connection|
  connection.each_request do |request|
    request.respond :ok, "hello, world!"
  end
end

begin
  sleep
rescue Interrupt
  supervisor.terminate
end

For more information on Celluloid's #supervise method, please see the Celluloid source code's implementation of #supervise

Clone this wiki locally