Method: CPEE::Controller#stop

Defined in:
lib/cpee/controller.rb

#stopObject

}}}



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/cpee/controller.rb', line 178

def stop # {{{
  t = @instance.stop
  t.run
  @callbacks.delete_if do |k,c|
    # only remove vote_callbacks, the other stuff is removed by
    # the instance stopping cleanup
    if c.method == :vote_callback
      c.callback
      true
    else
      false
    end
  end
  @thread.join if !@thread.nil? && @thread.alive?
  @callback = [] # everything should be empty now
end