examples/mano_tracker.rb in openwferu-0.9.4 vs examples/mano_tracker.rb in openwferu-0.9.5

- old
+ new

@@ -43,11 +43,12 @@ # see # http://groups.google.com/group/openwferu-users/browse_frm/thread/81294030fc52cd04 # for the context of this example # -require 'openwfe/engine/engine' +#require 'openwfe/engine/engine' +require 'openwfe/engine/file_persisted_engine' require 'openwfe/expressions/raw_prog' require 'openwfe/participants/storeparticipant' # @@ -82,22 +83,28 @@ CREATIVES = [ "Jamie", "Jeff", "John", "Jeremy" ] # # instantiate the engine (a transient one is sufficient for the example) -$engine = OpenWFE::engine.new - # - # setting up a transient engine +#$engine = OpenWFE::Engine.new + # no persistence +#$engine = OpenWFE::FilePersistedEngine.new + # persistence, but no caching (worst performance) + +$engine = OpenWFE::CachedFilePersistedEngine.new + # persistence and performance + $analyst_stores = {} $creative_stores = {} # # gathering the stores for our fictitious organization def add_stores (names, store_map) names.each do |name| - hp = OpenWFE::HashParticipant.new - $engine.register_participant(name, hp) + #hp = OpenWFE::HashParticipant.new + #$engine.register_participant(name, hp) + hp = $engine.register_participant(name, OpenWFE::YamlParticipant) store_map[name] = hp end end add_stores(ANALYSTS, $analyst_stores)