Module: HotTub::Reaper::Mixin

Included in:
Pool, Sessions
Defined in:
lib/hot_tub/reaper.rb

Overview

Mixin to dry up Reaper usage

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#reap_timeoutObject (readonly)

Returns the value of attribute reap_timeout.



53
54
55
# File 'lib/hot_tub/reaper.rb', line 53

def reap_timeout
  @reap_timeout
end

#reaperObject

Returns the value of attribute reaper.



53
54
55
# File 'lib/hot_tub/reaper.rb', line 53

def reaper
  @reaper
end

#shutdownObject (readonly)

Returns the value of attribute shutdown.



53
54
55
# File 'lib/hot_tub/reaper.rb', line 53

def shutdown
  @shutdown
end

Instance Method Details

#kill_reaperObject



71
72
73
74
75
76
# File 'lib/hot_tub/reaper.rb', line 71

def kill_reaper
  if @reaper
    @reaper.shutdown
    @reaper = nil if @shutdown
  end
end

#reap!Object

Raises:

  • (NoMethodError)


67
68
69
# File 'lib/hot_tub/reaper.rb', line 67

def reap!
  raise NoMethodError.new('#reap! must be redefined in your class')
end

#spawn_reaperObject



78
79
80
# File 'lib/hot_tub/reaper.rb', line 78

def spawn_reaper
  Reaper.spawn(self)
end