<commit_before>require 'simple_states'
require 'multi_json'
require 'thread'
require 'celluloid'
require 'core_ext/hash/compact'
require 'travis/build'
require 'travis/support'
require 'travis/serialization'
require 'travis/worker/factory'
require 'travis/worker/virtual_machine'
require 'travis/worker/reporters'
require 'travis/worker/utils/hard_timeout'

module Travis
  module Worker
    class Instance
      class BuildStallTimeoutError < StandardError; end

      include Celluloid
      include SimpleStates, Logging

      log_header { "#{name}:worker" }

      def self.create(name, config, broker_connection)
        Factory.new(name, config, broker_connection).worker
      end

      states :created, :starting, :ready, :working, :stopping, :stopped, :errored

      attr_accessor :state
      attr_reader :name, :vm, :broker_connection, :queue, :queue_name, :consumer, :config, :payload, :last_error, :observers

      def initialize(name, vm, broker_connection, queue_name, config, observers = [])
        raise ArgumentError, "worker name cannot be nil!" if name.nil?
        raise ArgumentError, "VM cannot be nil!" if vm.nil?
        raise ArgumentError, "broker connection cannot be nil!" if broker_connection.nil?<commit_msg>move the attr_readers to two lines<commit_after>require 'simple_states'
require 'multi_json'
require 'thread'
require 'celluloid'
require 'core_ext/hash/compact'
require 'travis/build'
require 'travis/support'
require 'travis/serialization'
require 'travis/worker/factory'
require 'travis/worker/virtual_machine'
require 'travis/worker/reporters'
require 'travis/worker/utils/hard_timeout'

module Travis
  module Worker
    class Instance
      class BuildStallTimeoutError < StandardError; end

      include Celluloid
      include SimpleStates, Logging

      log_header { "#{name}:worker" }

      def self.create(name, config, broker_connection)
        Factory.new(name, config, broker_connection).worker
      end

      states :created, :starting, :ready, :working, :stopping, :stopped, :errored

      attr_accessor :state
      attr_reader   :name, :vm, :broker_connection, :queue, :queue_name,
                    :consumer, :config, :payload, :last_error, :observers

      def initialize(name, vm, broker_connection, queue_name, config, observers = [])
        raise ArgumentError, "worker name cannot be nil!" if name.nil?
        raise ArgumentError, "VM cannot be nil!" if vm.nil?
        raise ArgumentError, "broker connection cannot be nil!" if broker_connection.nil?
{'fraction_non_alphanumeric': 0.09798498617147372, 'fraction_numerical': 0.0, 'mean_word_length': 4.146341463414634, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '335466', 'n_tokens_mistral': 753, 'n_tokens_neox': 743, 'n_words': 216}