Class: Hyrax::Event

Inherits:
Object
  • Object
show all
Defined in:
app/models/hyrax/event.rb

Overview

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 Publisher.

See Also:

Class Method Summary collapse

Class Method Details

.create(action, timestamp) ⇒ Object

Note:

it's advisable to use TimeService for timestamps, or use the create_now method provided

Creates an event in Redis

Parameters:

  • action (String)
  • timestamp (Integer)

20
21
22
# File 'app/models/hyrax/event.rb', line 20

def self.create(action, timestamp)
  store.create(action, timestamp)
end

.create_now(action) ⇒ Event

Creates an event in Redis with a timestamp generated now

Parameters:

  • action (String)

Returns:


36
37
38
# File 'app/models/hyrax/event.rb', line 36

def self.create_now(action)
  create(action, Hyrax::TimeService.time_in_utc.to_i)
end

.store#create

Returns:


26
27
28
# File 'app/models/hyrax/event.rb', line 26

def self.store
  Hyrax::RedisEventStore
end