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

Version Path
hyrax-5.0.1 app/models/hyrax/event.rb
hyrax-5.0.0 app/models/hyrax/event.rb
hyrax-5.0.0.rc3 app/models/hyrax/event.rb
hyrax-5.0.0.rc2 app/models/hyrax/event.rb
hyrax-5.0.0.rc1 app/models/hyrax/event.rb
hyrax-3.6.0 app/models/hyrax/event.rb
hyrax-4.0.0 app/models/hyrax/event.rb
hyrax-4.0.0.rc3 app/models/hyrax/event.rb
hyrax-4.0.0.rc2 app/models/hyrax/event.rb
hyrax-4.0.0.rc1 app/models/hyrax/event.rb
hyrax-3.5.0 app/models/hyrax/event.rb
hyrax-4.0.0.beta2 app/models/hyrax/event.rb
hyrax-3.4.2 app/models/hyrax/event.rb
hyrax-4.0.0.beta1 app/models/hyrax/event.rb
hyrax-3.4.1 app/models/hyrax/event.rb
hyrax-3.4.0 app/models/hyrax/event.rb
hyrax-3.3.0 app/models/hyrax/event.rb
hyrax-3.2.0 app/models/hyrax/event.rb
hyrax-3.1.0 app/models/hyrax/event.rb
hyrax-3.0.2 app/models/hyrax/event.rb