lib/wayfarer/task.rb in wayfarer-0.4.6 vs lib/wayfarer/task.rb in wayfarer-0.4.7
- old
+ new
@@ -1,36 +1,30 @@
# frozen_string_literal: true
module Wayfarer
+ # @!attribute [r] url
+ # @return [String] the URL to process
+ # @!attribute [r] batch
+ # @return [String] the batch the task belongs to
class Task
+ extend Forwardable
include Stringify
- attr_reader :url,
- :batch,
- :metadata
+ attr_reader :url, :batch
- stringify :url,
- :batch
+ stringify :url, :batch
+ delegate %i([] []=) => :@ephemeral
+
+ # @!visibility private
def initialize(url, batch)
@url = url
@batch = batch
- @metadata = OpenStruct.new
+ @ephemeral = {}
end
+ # @!visibility private
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
-
- def gc
- @gc ||= Wayfarer::GC.new(self)
end
end
end