diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-05 18:18:17 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-05 18:18:17 +0000 |
| commit | 88c3f7c4795da36c161ee340b535725b826aded2 (patch) | |
| tree | 3200dfdcf0162e44898b871a8ff4a3887710dcb8 /lib/puppet/event.rb | |
| parent | 7b7ac1846b729114d2e33cee9daa7f7a19739a3f (diff) | |
| download | puppet-88c3f7c4795da36c161ee340b535725b826aded2.tar.gz puppet-88c3f7c4795da36c161ee340b535725b826aded2.tar.xz puppet-88c3f7c4795da36c161ee340b535725b826aded2.zip | |
Changing how events work. Events are now responded to inline, while an object is being applied.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1177 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/event.rb')
| -rw-r--r-- | lib/puppet/event.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/puppet/event.rb b/lib/puppet/event.rb index f6ff87007..eb17750cc 100644 --- a/lib/puppet/event.rb +++ b/lib/puppet/event.rb @@ -75,6 +75,17 @@ module Puppet @subscriptions[stype][sname] << sub end + # Collect all of the subscriptions that target a specific event. + def self.targets_of(event, source) + type, name = self.split(source) + + @subscriptions[type][name].each { |sub| + if sub.match?(event) + yield sub + end + } + end + # Trigger the subscriptions related to an event, and then pass it up # as appropriate def self.trigger(source, event) @@ -245,7 +256,7 @@ module Puppet end def to_s - self.event.to_s + @source.to_s + " -> " + self.event.to_s end end end |
