<commit_before>class TestSubscriber < TestServiceBase
  Topic = 'test.topic'
  WildcardTopic = 'test.wildcard.*'
  Simulation = 'simulate.topic'
  Republish = 'test.republish'
  GroupReturn = "group_return"
  GroupTopic = "test.group"
  ExclusiveTopic = "test.exclusive"


  def self.get_callback
    @callback
  end

  def self.callback
    @callback = Proc.new
  end

  2.times do |i|
    listen_to ExclusiveTopic, true do
      publish(i, TestSubscriber::GroupReturn)
    end
  end

  2.times do
    listen_to GroupTopic do
      publish(request.body, TestSubscriber::GroupReturn)
      publish("2", TestSubscriber::GroupReturn)
    end
  end

  listen_to Topic do<commit_msg>New timeout listeners and adapted the old listener to new version<commit_after>class TestSubscriber < TestServiceBase
  TimeoutTopic = "test.timeout"
  Topic = 'test.topic'
  WildcardTopic = 'test.wildcard.*'
  Simulation = 'simulate.topic'
  Republish = 'test.republish'
  GroupReturn = "group_return"
  GroupTopic = "test.group"
  ExclusiveTopic = "test.exclusive"


  def self.get_callback
    @callback
  end

  def self.callback
    @callback = Proc.new
  end

  2.times do |i|
    listen_to ExclusiveTopic, {exclusive: true} do
      publish(i, TestSubscriber::GroupReturn)
    end
  end

  2.times do
    listen_to GroupTopic do
      publish(request.body, TestSubscriber::GroupReturn)
      publish("2", TestSubscriber::GroupReturn)
    end
  end

  listen_to TimeoutTopic, {exclusive: false, timeout: 2} do
    data, _, _ = Gilmour::Protocol.parse_response(request.body)
    puts "Will sleep for #{data} seconds now. But allowed timeout is 2."
    sleep data
    respond 'Pong!'
  end

  listen_to Topic do
{'fraction_non_alphanumeric': 0.09208972845336481, 'fraction_numerical': 0.004722550177095631, 'mean_word_length': 3.507978723404255, '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': '5823657', 'n_tokens_mistral': 560, 'n_tokens_neox': 542, 'n_words': 140}