Sha256: 8a2e684e523906711ce0e6b88003219131b13df8d4d325ae760ea0848d1ca454
Contents?: true
Size: 965 Bytes
Versions: 24
Compression:
Stored size: 965 Bytes
Contents
# frozen_string_literal: true module Hyrax ## # Events are timestamped, named actions that provide a streamed 'paper trail' # of certain repository activities. # # Not to be confused with the +Dry::Events+-based pub/sub interface at # {Hyrax::Publisher}. # # @see Hyrax::RedisEventStore class Event ## # Creates an event in Redis # # @note it's advisable to use {Hyrax::TimeService} for timestamps, or use the # {.create_now} method provided # # @param [String] action # @param [Integer] timestamp def self.create(action, timestamp) store.create(action, timestamp) end ## # @return [#create] def self.store Hyrax::RedisEventStore end ## # Creates an event in Redis with a timestamp generated now # # @param [String] action # # @return [Event] def self.create_now(action) create(action, Hyrax::TimeService.time_in_utc.to_i) end end end
Version data entries
24 entries across 24 versions & 1 rubygems