# frozen_string_literal: true module Wayfarer class Task include Stringify attr_reader :url, :batch, :metadata attr_accessor :job stringify :url, :batch def initialize(url, batch) @url = url @batch = batch @metadata = OpenStruct.new end def ==(other) [url, batch] == [other.url, other.batch] end def barrier @barrier ||= Wayfarer::Redis::Barrier.new(batch) end def counter @counter ||= Wayfarer::Redis::Counter.new(batch) end end end