<commit_before>slimline::async::init() {
  if (( ${SLIMLINE_ENABLE_ASYNC_AUTOLOAD:-1} && ! ${+functions[async_init]} && ! ${+functions[async_start_worker]} )); then
    source "${slimline_path}/zsh-async/async.zsh"
  fi

  slimline_async_tasks="${1}"
  slimline_async_callback_complete="${2}"
  slimline_async_worker_name="prompt_slimline"

  async_init
  async_start_worker "${slimline_async_worker_name}" -u
  async_register_callback "${slimline_async_worker_name}" slimline::async::callback
}

slimline::async::callback() {
  local job=${1}
  local has_next=${6}

  local complete_function="${job}_complete"
  ${complete_function} "$@"

  slimline_async_tasks_complete=$(( slimline_async_tasks_complete + 1 ))

  if (( ! has_next )); then
    if (( slimline_async_tasks_complete == ${#${=slimline_async_tasks}} )); then
      ${slimline_async_callback_complete} "all_tasks_complete"
    else
      ${slimline_async_callback_complete} "task_complete"
    fi
  fi
}

slimline::async::start_tasks() {
  if (( ! ${#${=slimline_async_tasks}} )); then
    ${slimline_async_callback_complete} "all_tasks_complete"
    return
  fi

  local event="${1}"
  if [[ "${event}" == "precmd" ]]; then
    if (( EPOCHREALTIME - ${slimline_async_last_call:-0} <= 0.5 )); then return; fi
    ${slimline_async_callback_complete} "precmd"
  fi

  async_flush_jobs "${slimline_async_worker_name}"
  slimline_async_last_call=${EPOCHREALTIME}
  slimline_async_tasks_complete=0
  for task in ${=slimline_async_tasks}; do
    async_job "${slimline_async_worker_name}" "${task}" "$(builtin pwd)"
  done
}
<commit_msg>Rename variable for better clarity<commit_after>slimline::async::init() {
  if (( ${SLIMLINE_ENABLE_ASYNC_AUTOLOAD:-1} && ! ${+functions[async_init]} && ! ${+functions[async_start_worker]} )); then
    source "${slimline_path}/zsh-async/async.zsh"
  fi

  slimline_async_tasks="${1}"
  slimline_async_task_complete_callback="${2}"
  slimline_async_worker_name="prompt_slimline"

  async_init
  async_start_worker "${slimline_async_worker_name}" -u
  async_register_callback "${slimline_async_worker_name}" slimline::async::callback
}

slimline::async::callback() {
  local job=${1}
  local has_next=${6}

  local complete_function="${job}_complete"
  ${complete_function} "$@"

  slimline_async_tasks_complete=$(( slimline_async_tasks_complete + 1 ))

  if (( ! has_next )); then
    if (( slimline_async_tasks_complete == ${#${=slimline_async_tasks}} )); then
      ${slimline_async_task_complete_callback} "all_tasks_complete"
    else
      ${slimline_async_task_complete_callback} "task_complete"
    fi
  fi
}

slimline::async::start_tasks() {
  if (( ! ${#${=slimline_async_tasks}} )); then
    ${slimline_async_task_complete_callback} "all_tasks_complete"
    return
  fi

  local event="${1}"
  if [[ "${event}" == "precmd" ]]; then
    if (( EPOCHREALTIME - ${slimline_async_last_call:-0} <= 0.5 )); then return; fi
    ${slimline_async_task_complete_callback} "precmd"
  fi

  async_flush_jobs "${slimline_async_worker_name}"
  slimline_async_last_call=${EPOCHREALTIME}
  slimline_async_tasks_complete=0
  for task in ${=slimline_async_tasks}; do
    async_job "${slimline_async_worker_name}" "${task}" "$(builtin pwd)"
  done
}

{'fraction_non_alphanumeric': 0.14975247524752475, 'fraction_numerical': 0.006806930693069307, 'mean_word_length': 5.952688172043011, 'pattern_counts': {'":': 0, '<': 5, '<?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': '709425', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1161, 'n_words': 170}