A simple way to watch and extend the Isolate lifecycle.
Isolate::Events.watch Isolate::Sandbox, :initialized do |sandbox| puts "A sandbox just got initialized: #{sandbox}" end
Read the source for Isolate::Sandbox and Isolate::Entry to see what sort of events are fired.
Watch for an event called name
from an instance of
klass
. block
will be called when the event
occurs. Block args vary by event, but usually an instance of the relevant
class is passed.
# File lib/isolate/events.rb, line 19 def self.watch klass, name, &block watchers[[klass, name]] << block end