Sha256: d4ae231730cf5a1c8fd4b48f65f57a0d525c889a266063e611454e9e82d81e34
Contents?: true
Size: 721 Bytes
Versions: 39
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true module LinkedRails class Cache extend RDF::Serializers::HextupleSerializer class << self def invalidate(iri) write([invalidate_resource(iri)]) end def invalidate_all invalidate(Vocab.sp.Variable) end def write(delta) Redis.new.publish( ENV['CACHE_CHANNEL'], delta.map { |s| Oj.fast_generate(value_to_hex(*s)) }.join("\n") ) end private def invalidate_resource(iri) [ Vocab.sp.Variable, Vocab.sp.Variable, Vocab.sp.Variable, LinkedRails::Vocab.ontola["invalidate?graph=#{CGI.escape(iri)}"] ] end end end end
Version data entries
39 entries across 39 versions & 1 rubygems