<commit_before>require 'celluloid/autostart'
require 'donaghy/heart_beater'
require 'donaghy/middleware/chain'
require 'donaghy/middleware/stats'
require 'donaghy/middleware/retry'
require 'donaghy/middleware/logging'

module Donaghy
  class EventHandler
    include Celluloid
    include Logging

    task_class TaskThread

    def self.default_middleware
      Middleware::Chain.new do |c|
        c.add Middleware::Retry
        c.add Middleware::Stats
        c.add Middleware::Logging
      end
    end

    BEAT_TIMEOUT = 5

    attr_reader :manager, :uid, :beat_timeout, :only_distribute
    attr_accessor :beater
    def initialize(manager, opts = {})
      @manager = manager
      @uid = "#{manager.name}_#{Celluloid::UUID.generate}"
      @beat_timeout = (opts[:heart_beat_timeout] || BEAT_TIMEOUT)
      @only_distribute = opts[:only_distribute]<commit_msg>mebbe we try no task class on the event handler<commit_after>require 'celluloid/autostart'
require 'donaghy/heart_beater'
require 'donaghy/middleware/chain'
require 'donaghy/middleware/stats'
require 'donaghy/middleware/retry'
require 'donaghy/middleware/logging'

module Donaghy
  class EventHandler
    include Celluloid
    include Logging

    def self.default_middleware
      Middleware::Chain.new do |c|
        c.add Middleware::Retry
        c.add Middleware::Stats
        c.add Middleware::Logging
      end
    end

    BEAT_TIMEOUT = 5

    attr_reader :manager, :uid, :beat_timeout, :only_distribute
    attr_accessor :beater
    def initialize(manager, opts = {})
      @manager = manager
      @uid = "#{manager.name}_#{Celluloid::UUID.generate}"
      @beat_timeout = (opts[:heart_beat_timeout] || BEAT_TIMEOUT)
      @only_distribute = opts[:only_distribute]
{'fraction_non_alphanumeric': 0.09742120343839542, 'fraction_numerical': 0.001146131805157593, 'mean_word_length': 3.731707317073171, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1754929', 'n_tokens_mistral': 559, 'n_tokens_neox': 562, 'n_words': 118}