Class: OpenWFE::Journal
- Includes:
- MonitorMixin, FeiMixin, JournalReplay, OwfeServiceLocator
- Defined in:
- lib/openwfe/expool/journal.rb
Overview
Keeping a replayable track of the events in an OpenWFEru engine
Defined Under Namespace
Classes: Bucket
Constant Summary collapse
- FREQ =
"1m"
Instance Attribute Summary collapse
-
#donedir ⇒ Object
readonly
Returns the value of attribute donedir.
-
#workdir ⇒ Object
readonly
Returns the value of attribute workdir.
Attributes included from ServiceMixin
Attributes included from Contextual
Instance Method Summary collapse
-
#initialize(service_name, application_context) ⇒ Journal
constructor
once per minute, makes sure the buckets are flushed.
-
#stop ⇒ Object
Will flush the journal of every open instance.
Methods included from JournalReplay
#analyze, #decompose, #load_events, #replay, #replay_at_error, #replay_at_last_error
Methods included from OwfeServiceLocator
#get_engine, #get_error_journal, #get_expool, #get_expression_map, #get_expression_pool, #get_expression_storage, #get_expression_storages, #get_journal, #get_participant_map, #get_scheduler, #get_wfid_generator
Methods included from ServiceMixin
Methods included from Contextual
#get_work_directory, #init_service, #lookup
Methods included from Logging
#ldebug, #ldebug_callstack, #lerror, #lfatal, #linfo, #llog, #lunknown, #lwarn
Constructor Details
#initialize(service_name, application_context) ⇒ Journal
once per minute, makes sure the buckets are flushed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/openwfe/expool/journal.rb', line 67 def initialize (service_name, application_context) super @buckets = {} @workdir = get_work_directory + "/journal" @donedir = @workdir + "/done" FileUtils.makedirs(@donedir) unless File.exist?(@donedir) get_expression_pool.add_observer(:all) do |event, *args| #ldebug { ":#{event} for #{args[0].class.name}" } queue_event(event, *args) end @thread_id = get_scheduler.schedule_every(FREQ) do flush_buckets() end end |
Instance Attribute Details
#donedir ⇒ Object (readonly)
Returns the value of attribute donedir.
61 62 63 |
# File 'lib/openwfe/expool/journal.rb', line 61 def donedir @donedir end |
#workdir ⇒ Object (readonly)
Returns the value of attribute workdir.
61 62 63 |
# File 'lib/openwfe/expool/journal.rb', line 61 def workdir @workdir end |
Instance Method Details
#stop ⇒ Object
Will flush the journal of every open instance.
91 92 93 94 |
# File 'lib/openwfe/expool/journal.rb', line 91 def stop get_scheduler.unschedule(@thread_id) if @thread_id flush_buckets() end |