<commit_before>(ns ws.clojure.sample.handler
  (:require [immutant.web.async :as async]
            [ws.clojure.sample.receiver :refer [receiver clients]]))

(defn ws-handler
  [request]
  (clojure.pprint/pprint request)
  (async/as-channel request
    {:on-open    (fn [channel]
                   (swap! clients assoc channel true)
                   (println channel "Connection established"))
     :on-close   (fn [chan {:keys [code reason]}]
                   (println "channel closed: " code " " reason))
     :on-error   (fn [chan throwable]
                   (println "error: " (.toString throwable)))
     :on-message (fn [chan message]
                   (let [chat-receiver (get receiver :chat)
                         data-receiver (get receiver :data)]
                     (chat-receiver message)))}))<commit_msg>BACK-1 [*] remove pprint;<commit_after>(ns ws.clojure.sample.handler
  (:require [immutant.web.async :as async]
            [ws.clojure.sample.receiver :refer [receiver clients]]))

(defn ws-handler
  [request]
  (async/as-channel request
    {:on-open    (fn [channel]
                   (swap! clients assoc channel true)
                   (println channel "Connection established"))
     :on-close   (fn [chan {:keys [code reason]}]
                   (println "channel closed: " code " " reason))
     :on-error   (fn [chan throwable]
                   (println "error: " (.toString throwable)))
     :on-message (fn [chan message]
                   (let [chat-receiver (get receiver :chat)
                         data-receiver (get receiver :data)]
                     (chat-receiver message)))}))
{'fraction_non_alphanumeric': 0.1288156288156288, 'fraction_numerical': 0.0006105006105006105, 'mean_word_length': 1.9854280510018214, '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': '5755397', 'n_tokens_mistral': 488, 'n_tokens_neox': 463, 'n_words': 125}