<commit_before>require 'mq'

# AMQP
# connections:
# - unlike stomp, we can share one connection across multiple channels
# - set host and authorization options on AMQP.connect
# 
# MQ
# create new channel for an AMQP connection
# options for queue and exchange objects include:
# - :durable => true
# - :ack => "client" ????

module RosettaQueue
  module Gateway

    class AmqpAdapter < BaseAdapter

      def initialize(user, pass, host, port=nil)
        @user, @pass, @host, @port = user, pass, host, port
      end

      def disconnect; end

      def receive_once(destination, opts={})
        exchange_strategy_for(destination).do_single_exchange(destination, opts)
      end

      def receive_with(message_handler)
        destination = destination_for(message_handler)
        exchange_strategy_for(destination).do_exchange(destination, message_handler)
      end

      def send_message(destination, message, options=nil)
        exchange_strategy_for(destination).publish_to_exchange(destination, message, options)
      end

      def unsubscribe; end<commit_msg>added spaces<commit_after>require 'mq'

# AMQP
# connections:
# - unlike stomp, we can share one connection across multiple channels
# - set host and authorization options on AMQP.connect
# 
# MQ
# create new channel for an AMQP connection
# options for queue and exchange objects include:
# - :durable => true
# - :ack => "client" ????




module RosettaQueue
  module Gateway

    class AmqpAdapter < BaseAdapter

      def initialize(user, pass, host, port=nil)
        @user, @pass, @host, @port = user, pass, host, port
      end

      def disconnect; end

      def receive_once(destination, opts={})
        exchange_strategy_for(destination).do_single_exchange(destination, opts)
      end

      def receive_with(message_handler)
        destination = destination_for(message_handler)
        exchange_strategy_for(destination).do_exchange(destination, message_handler)
      end

      def send_message(destination, message, options=nil)
        exchange_strategy_for(destination).publish_to_exchange(destination, message, options)
      end

      def unsubscribe; end
{'fraction_non_alphanumeric': 0.08341056533827618, 'fraction_numerical': 0.0, 'mean_word_length': 3.6231263383297643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '228193', 'n_tokens_mistral': 619, 'n_tokens_neox': 581, 'n_words': 176}