Class: OpenWFE::InMemoryHistory

Inherits:
BaseHistory show all
Defined in:
lib/openwfe/expool/history.rb

Overview

The simplest implementation, stores all history entries in memory.

DO NOT USE IN PRODUCTION, it will trigger an ‘out of memory’ error sooner or later.

Is only used for unit testing purposes.

Instance Attribute Summary

Attributes included from ServiceMixin

#service_name

Attributes included from Contextual

#application_context

Instance Method Summary collapse

Methods inherited from BaseHistory

#log

Methods included from HistoryMixin

#log, #service_init

Methods included from ServiceMixin

#service_init, #stop

Methods included from Contextual

#get_work_directory, #init_service, #lookup

Methods included from Logging

#ldebug, #ldebug_callstack, #lerror, #lfatal, #linfo, #llog, #lunknown, #lwarn

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

Constructor Details

#initialize(service_name, application_context) ⇒ InMemoryHistory

Returns a new instance of InMemoryHistory.



118
119
120
121
122
# File 'lib/openwfe/expool/history.rb', line 118

def initialize (service_name, application_context)
    super

    @output = []
end

Instance Method Details

#entriesObject

Returns the array of entries.



127
128
129
# File 'lib/openwfe/expool/history.rb', line 127

def entries
    @output
end

#to_sObject

Returns all the entries as a String.



134
135
136
137
138
139
140
# File 'lib/openwfe/expool/history.rb', line 134

def to_s
    s = ""
    @output.each do |entry|
        s << entry.to_s
    end
    s
end