Module: OpenWFE::ThreadedStorageMixin

Included in:
ThreadedYamlFileExpressionStorage
Defined in:
lib/openwfe/expool/threadedexpstorage.rb

Overview

This mixin gathers all the logic for a threaded expression storage, one that doesn’t immediately stores workitems (removes overriding operations). Using this threaded storage brings a very important perf benefit.

Constant Summary collapse

THREADED_FREQ =

milliseconds

"427"

Instance Method Summary collapse

Instance Method Details

#find_expressions(options) ⇒ Object

calls process_queue() before the call the super class each() method.



73
74
75
76
77
# File 'lib/openwfe/expool/threadedexpstorage.rb', line 73

def find_expressions (options)

    process_queue
    super
end

#stopObject

Will take care of stopping the ‘queue processing’ thread.



60
61
62
63
64
65
66
67
# File 'lib/openwfe/expool/threadedexpstorage.rb', line 60

def stop

    get_scheduler.unschedule(@thread_id) if @thread_id

    process_queue
        #
        # flush every remaining events (especially the :delete ones)
end