lib/tobox/worker.rb in tobox-0.1.6 vs lib/tobox/worker.rb in tobox-0.2.0

- old
+ new

@@ -1,17 +1,24 @@ # frozen_string_literal: true module Tobox class Worker + attr_reader :label + def initialize(label, configuration) + @label = label @wait_for_events_delay = configuration[:wait_for_events_delay] @handlers = configuration.handlers || {} @fetcher = Fetcher.new(label, configuration) @finished = false return unless (message_to_arguments = configuration.arguments_handler) define_singleton_method(:message_to_arguments, &message_to_arguments) + end + + def finished? + @finished end def finish! @finished = true end