<commit_before>#!/usr/bin/env ruby

require 'rubygems'
require 'nats/client'

trap("TERM") { NATS.stop }
trap("INT")  { NATS.stop }

def usage
  puts "Usage: ruby queue_sub.rb <subject> <queue name>"; exit
end

subject, queue_group = ARGV
usage unless subject and queue_group

NATS.on_error { |err| puts "Server Error: #{err}"; exit! }

NATS.start do
  puts "Listening on [#{subject}], queue group [#{queue_group}]"
  NATS.subscribe(subject, queue_group) { |msg| puts "Received '#{msg}'" }
end<commit_msg>Updated to new syntax<commit_after>#!/usr/bin/env ruby

require 'rubygems'
require 'nats/client'

trap("TERM") { NATS.stop }
trap("INT")  { NATS.stop }

def usage
  puts "Usage: ruby queue_sub.rb <subject> <queue name>"; exit
end

subject, queue_group = ARGV
usage unless subject and queue_group

NATS.on_error { |err| puts "Server Error: #{err}"; exit! }

NATS.start do
  puts "Listening on [#{subject}], queue group [#{queue_group}]"
  NATS.subscribe(subject, :queue => queue_group) { |msg| puts "Received '#{msg}'" }
end
{'fraction_non_alphanumeric': 0.15856031128404668, 'fraction_numerical': 0.0, 'mean_word_length': 4.982558139534884, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '3179384', 'n_tokens_mistral': 385, 'n_tokens_neox': 376, 'n_words': 107}