<commit_before>module Stompede
  # dispatches a frame to the application, this is implemented as an actor so
  # that the `read_loop` can pipeline and continue processing messages while
  # the message is being dispatched. Otherwise we might get deadlocks.
  class Dispatcher
    include Celluloid

    def initialize
      @subscriptions ||= Hash.new { |h, k| h[k] = Set.new }
    end

    def close(session, app)
      session.subscriptions.each do |subscription|
        unsubscribe(subscription)
      end
    end

    def message_all(destination, body, headers = {})
      @subscriptions.fetch(destination, []).dup.each do |subscription|
        subscription.message(body, headers)
      end
    end

    def subscribe(subscription)
      @subscriptions[subscription.destination].add(subscription)
    end
<commit_msg>don't wait when sending messages to everyone<commit_after>module Stompede
  # dispatches a frame to the application, this is implemented as an actor so
  # that the `read_loop` can pipeline and continue processing messages while
  # the message is being dispatched. Otherwise we might get deadlocks.
  class Dispatcher
    include Celluloid

    def initialize
      @subscriptions ||= Hash.new { |h, k| h[k] = Set.new }
    end

    def close(session, app)
      session.subscriptions.each do |subscription|
        unsubscribe(subscription)
      end
    end

    def message_all(destination, body, headers = {})
      @subscriptions.fetch(destination, []).dup.each do |subscription|
        subscription.message(body, headers.merge(wait: false))
      end
    end

    def subscribe(subscription)
      @subscriptions[subscription.destination].add(subscription)
    end

{'fraction_non_alphanumeric': 0.07959905660377359, 'fraction_numerical': 0.0, 'mean_word_length': 3.27455919395466, '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': '4595222', 'n_tokens_mistral': 465, 'n_tokens_neox': 459, 'n_words': 153}