 (defn online-users
   []
   (filter online? (users)))
-
-(defn get-name
-  [user]
-  (.getName user))
 
 ; This is the channel for queuing the online user requests
 (def online-collector-chan (chan (sliding-buffer collector-chan-size)))

    (go
      (let [ [v _] (alts! [ch (timeout timeout-collect-reader-release)])
             elapsed (- (System/currentTimeMillis) start-ts) ]
        (swap! busy free [(get-name user) connector])
        (cond
          (nil? v) (log-timeout user connector elapsed)
          (= v Collector/NO_CREDENTIALS) (log-no-credentials user connector elapsed)

  [msecs]
  (/ msecs 1000))

(defn get-name
  [user]
  (.getName user))

(def busy (atom #{}))

(defn- mark-busy
 [current-busy v]
 (conj current-busy v))

(defn- mark-free
 [current-busy v]
 (disj current-busy v))

(defn- busy? [u c]
  (@busy [(get-name u) c]))

(defn- busy!
  [u c]
  (swap! busy mark-busy [(get-name u) c]))

(defn- free!
  [u c]
  (swap! busy mark-free [(get-name u) c]))

(def collector-chan-size 512)
(def number-of-readers 32)
