<commit_before># encoding: utf-8

module FiniteMachine
  # An asynchronous messages proxy
  class AsyncProxy

    attr_reader :context

    # Initialize an AsynxProxy
    #
    # @param [Object] context
    #   the context this proxy is associated with
    #
    # @api private
    def initialize(context)
      @context = context
    end

    # Delegate asynchronous event to event queue
    #
    # @api private
    def method_missing(method_name, *args, &block)
      @event_queue = FiniteMachine.event_queue
      @event_queue << AsyncCall.build(@context, Callable.new(method_name), *args, &block)
    end
  end # AsyncProxy
end # FiniteMachine<commit_msg>Change async proxy to use thread context and threadsafe attribute.<commit_after># encoding: utf-8

module FiniteMachine
  # An asynchronous messages proxy
  class AsyncProxy
    include Threadable
    include ThreadContext

    attr_threadsafe :context

    # Initialize an AsynxProxy
    #
    # @param [Object] context
    #   the context this proxy is associated with
    #
    # @api private
    def initialize(context)
      self.context = context
    end

    # Delegate asynchronous event to event queue
    #
    # @api private
    def method_missing(method_name, *args, &block)
      event_queue << AsyncCall.build(context, Callable.new(method_name), *args, &block)
    end
  end # AsyncProxy
end # FiniteMachine
{'fraction_non_alphanumeric': 0.07241129616220131, 'fraction_numerical': 0.001448225923244026, 'mean_word_length': 3.113095238095238, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2116133', 'n_tokens_mistral': 404, 'n_tokens_neox': 387, 'n_words': 124}