# File lib/puppet/transaction/event_manager.rb, line 33
33:   def queue_events(resource, events)
34:     @events += events
35: 
36:     # Do some basic normalization so we're not doing so many
37:     # graph queries for large sets of events.
38:     events.inject({}) do |collection, event|
39:       collection[event.name] ||= []
40:       collection[event.name] << event
41:       collection
42:     end.collect do |name, list|
43:       # It doesn't matter which event we use - they all have the same source
44:       # and name here.
45:       event = list[0]
46: 
47:       # Collect the targets of any subscriptions to those events.  We pass
48:       # the parent resource in so it will override the source in the events,
49:       # since eval_generated children can't have direct relationships.
50:       relationship_graph.matching_edges(event, resource).each do |edge|
51:         next unless method = edge.callback
52:         next unless edge.target.respond_to?(method)
53: 
54:         queue_events_for_resource(resource, edge.target, method, list)
55:       end
56: 
57:       queue_events_for_resource(resource, resource, :refresh, [event]) if resource.self_refresh? and ! resource.deleting?
58:     end
59:   end