Class: ActiveWorker::TerminationEvent

Inherits:
FinishedEvent show all
Defined in:
lib/active_worker/termination_event.rb

Class Method Summary collapse

Methods inherited from FinishedEvent

#generate_message

Methods inherited from Event

#event_type, exists_for_configurations?, #fields_for_view, #generate_message, #get_pid, #get_worker_pid, #set_message, #set_process_information

Methods included from Behavior::HasRootObject

#get_root_object_id, included, #notify_root_of_child_started, #notify_root_of_finished, #root_owner, #set_root_object

Class Method Details

.create_termination_from_configuration(configuration) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/active_worker/termination_event.rb', line 12

def self.create_termination_from_configuration(configuration)
  constructor_options = {
      :message => "#{configuration.event_name} was terminated",
      :configuration => configuration,
  }
  create! constructor_options
end

.from_termination(root_configuration) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/active_worker/termination_event.rb', line 4

def self.from_termination(root_configuration)
  events = []
  root_configuration.configurations_for_events.each do |configuration|
    events << create_termination_from_configuration(configuration) unless configuration.completed?
  end
  events
end