<commit_before>module EventMachine
  module WorkQueue
    class WorkQueue
      attr_accessor :queue, :block

      def initialize(&block)
        @queue = EM::Queue.new
        @status = false
        @block = block

        @queue_worker = Proc.new do |i|
          if running?
            @block.call i
            @queue.pop &@queue_worker
          end
        end
      end

      def push(val)
        self.queue.push val
      end

      def running?
        @status
      end

      def start
        @status = true
        @queue.pop &@queue_worker
      end<commit_msg>added jog method<commit_after>module EventMachine
  module WorkQueue
    class WorkQueue
      attr_accessor :queue, :block

      def initialize(&block)
        @queue = EM::Queue.new
        @status = false
        @block = block
      end

      def push(val)
        self.queue.push val
      end

      def running?
        @status
      end
      
      def jog(n = 1)
        n.times { @queue.pop &@block }
      end

      def start
        @status = true
        @queue_worker = Proc.new do |i|
          if running?
            @block.call i
            @queue.pop &@queue_worker if running?
          end
        end
        
        @queue.pop &@queue_worker
      end
{'fraction_non_alphanumeric': 0.07539682539682539, 'fraction_numerical': 0.0007936507936507937, 'mean_word_length': 1.3882575757575757, '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': '6415097', 'n_tokens_mistral': 370, 'n_tokens_neox': 357, 'n_words': 102}