<commit_before>##
# Abstract runner class to control instance of Midori Server
class Midori::Runner
  attr_reader :bind, :port

  def initialize(api, configure = Midori::Configure)
    @logger = configure.logger
    @bind = configure.bind
    @port = configure.port
    @before = configure.before
    @api = ((api.is_a?Midori::APIEngine) ? api : Midori::APIEngine.new(api, configure.route_type))
  end

  # Get Midori server whether running
  # @return [Boolean] [true] running
  # @return [Boolean] [false] not running
  def running?
    !!@server_signature
  end

  # Start the Midori server
  # @note This is an async method, but no callback
  def start
    return if running?

    EventMachine.set_simultaneous_accept_count(40) unless RUBY_PLATFORM == 'java'
    EventMachine.run do
      @before.call<commit_msg>Fix before call<commit_after>##
# Abstract runner class to control instance of Midori Server
class Midori::Runner
  attr_reader :bind, :port

  def initialize(api, configure = Midori::Configure)
    @logger = configure.logger
    @bind = configure.bind
    @port = configure.port
    @before = configure.before
    @api = ((api.is_a?Midori::APIEngine) ? api : Midori::APIEngine.new(api, configure.route_type))
  end

  # Get Midori server whether running
  # @return [Boolean] [true] running
  # @return [Boolean] [false] not running
  def running?
    !!@server_signature
  end

  # Start the Midori server
  # @note This is an async method, but no callback
  def start
    return if running?

    EventMachine.set_simultaneous_accept_count(40) unless RUBY_PLATFORM == 'java'
    EventMachine.run do
      async :before do
        @before.call
      end
      before
{'fraction_non_alphanumeric': 0.09560570071258907, 'fraction_numerical': 0.0023752969121140144, 'mean_word_length': 3.629120879120879, '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': '1515373', 'n_tokens_mistral': 521, 'n_tokens_neox': 506, 'n_words': 158}