Class: Hyrax::Event
- Inherits:
-
Object
- Object
- Hyrax::Event
- 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.
Class Method Summary collapse
-
.create(action, timestamp) ⇒ Object
Creates an event in Redis.
-
.create_now(action) ⇒ Event
Creates an event in Redis with a timestamp generated now.
- .store ⇒ #create
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
20 21 22 |
# File 'app/models/hyrax/event.rb', line 20 def self.create(action, ) store.create(action, ) end |
.create_now(action) ⇒ Event
Creates an event in Redis with a timestamp generated now
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
26 27 28 |
# File 'app/models/hyrax/event.rb', line 26 def self.store Hyrax::RedisEventStore end |