Sha256: 0949958f8d002c17fc10e5947fab5b815201d546be7975aed2909f7be31dd7a6

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

module Tickwork
  class DataStore

    # This is an abstract parent class, ruby style :)
    #
    # Tickwork requires a data store to record the last time events ran
    # Ideally, this would be an optimistic write, but it doesn't really matter.
    # It doesn't matter because our goal is errrs for at least once, vs. at most or exactly
    # So we run, we record that we ran. There's a chance that another process also ran at the same time
    # e.g we both read the same 'last time running'
    # In practice, this shouldn't happen unless our external ticker is called faster than our jobs can run


    # Providers should implement
    #
    # def read(key)
    #
    # end
    # 
    # def write(key, value)
    #
    # end
    #
    # note: keys will be prefixed with '_tickwork_' both for easy identification and also to 
    # help avoid conflicts with the rest of the app
    #
    # Keen observers will note that this interface is compatible with ActiveSupport::Cache::Store. So you should
    # be able to just drop an instance of Store in and be ready to go. Preferably with a cache expiration time
    # longer than your max_catchup value

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tickwork-0.9.2 lib/tickwork/data_store.rb
tickwork-0.9.1 lib/tickwork/data_store.rb
tickwork-0.9.0 lib/tickwork/data_store.rb
tickwork-0.1.0 lib/tickwork/data_store.rb