<commit_before>(ns gorillalabs.tesla.component.socket
  (:require [taoensso.sente :as sente]
            [taoensso.sente.server-adapters.http-kit :refer (get-sch-adapter)]
            [mount.core :as mnt]
            [clojure.tools.logging :as log]))

(declare socket)

(defn- start []
  (log/info "-> Starting sente socket ")
  (sente/make-channel-socket! (get-sch-adapter) {:packet :edn}))

(defn- stop [self]
  (log/info "<- Stopping sente socket."))

(mnt/defstate socket
              :start (start)
              :stop (stop socket))<commit_msg>Add user-id-fn<commit_after>(ns gorillalabs.tesla.component.socket
  (:require [taoensso.sente :as sente]
            [taoensso.sente.server-adapters.http-kit :refer (get-sch-adapter)]
            [mount.core :as mnt]
            [clojure.tools.logging :as log]))

(declare socket)

(defn- start []
  (log/info "-> Starting sente socket ")
  (sente/make-channel-socket! (get-sch-adapter) {:packet :edn :user-id-fn (fn [ring-req] (str (java.util.UUID/randomUUID)))}))

(defn- stop [self]
  (log/info "<- Stopping sente socket."))

(mnt/defstate socket
              :start (start)
              :stop (stop socket))
{'fraction_non_alphanumeric': 0.16223175965665235, 'fraction_numerical': 0.0, 'mean_word_length': 2.773462783171521, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5561210', 'n_tokens_mistral': 424, 'n_tokens_neox': 417, 'n_words': 87}