Class: LinkedRails::InvalidationStreamWorker

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/workers/linked_rails/invalidation_stream_worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(type, iri, resource_type) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'app/workers/linked_rails/invalidation_stream_worker.rb', line 5

def perform(type, iri, resource_type)
  entry = {
    type: type,
    resource: iri,
    resourceType: resource_type
  }
  id = Storage.xadd(:stream, LinkedRails.cache_stream, entry)

  raise('No message id returned, implies failure') if id.blank?
end