lib/openwfe/engine/file_persisted_engine.rb in openwferu-0.9.4 vs lib/openwfe/engine/file_persisted_engine.rb in openwferu-0.9.5

- old
+ new

@@ -49,18 +49,44 @@ # # An engine persisted to a tree of yaml files # class FilePersistedEngine < Engine - # - # Overrides the method already found in Engine with a persisted - # expression storage - # - def build_expression_storage () + protected - @application_context[:work_directory] = "./work" + # + # Overrides the method already found in Engine with a persisted + # expression storage + # + def build_expression_storage () - init_service(S_EXPRESSION_STORAGE, YamlFileExpressionStorage) - end - + @application_context[:work_directory] = "./work" + + init_service(S_EXPRESSION_STORAGE, YamlFileExpressionStorage) + end + end + + # + # An engine with a cache in front of its file persisted expression storage. + # + class CachedFilePersistedEngine < Engine + + protected + + def build_expression_storage () + + @application_context[:expression_cache_size] = 1000 + @application_context[:work_directory] = "./work" + + init_service( + S_EXPRESSION_STORAGE, + CacheExpressionStorage) + + #init_service( + # S_EXPRESSION_STORAGE + ".1", + # YamlFileExpressionStorage) + init_service( + S_EXPRESSION_STORAGE + ".1", + ThreadedYamlFileExpressionStorage) + end end end