summaryrefslogtreecommitdiffstats
path: root/lib/puppet/transaction
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-10-29 00:23:05 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit2cbd9e85259ed1742f8a54a7e5b9825d0bb79d5e (patch)
treebafbe77d88527b56c3d10a975180a1748fa971da /lib/puppet/transaction
parent6a450c51eedc38b73d79389c19b8d5e5964a9d71 (diff)
downloadpuppet-2cbd9e85259ed1742f8a54a7e5b9825d0bb79d5e.tar.gz
puppet-2cbd9e85259ed1742f8a54a7e5b9825d0bb79d5e.tar.xz
puppet-2cbd9e85259ed1742f8a54a7e5b9825d0bb79d5e.zip
Switching transactions to callback-based events
Events are now queued as they are created, and the queues are managed through simple interfaces, rather than collecting events over time and responding to them inline. This drastically simplifies event management, and will make moving it to a separate system essentially trivial. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/transaction')
-rw-r--r--lib/puppet/transaction/event.rb19
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/puppet/transaction/event.rb b/lib/puppet/transaction/event.rb
index 54c092e65..5d422f93d 100644
--- a/lib/puppet/transaction/event.rb
+++ b/lib/puppet/transaction/event.rb
@@ -1,21 +1,8 @@
require 'puppet'
-require 'puppet/util/methodhelper'
-require 'puppet/util/errors'
-
-# events are transient packets of information; they result in one or more (or none)
-# subscriptions getting triggered, and then they get cleared
-# eventually, these will be passed on to some central event system
-class Puppet::Transaction::Event
- include Puppet::Util::MethodHelper
- include Puppet::Util::Errors
-
- attr_reader :name, :source
-
- def initialize(name, source)
- @name, @source = name, source
- end
+# A simple struct for storing what happens on the system.
+Puppet::Transaction::Event = Struct.new(:name, :resource, :property, :result, :log, :previous_value, :desired_value) do
def to_s
- source.to_s + " -> " + name.to_s
+ log
end
end