       (wrap-resource "public")
       (wrap-file-info)))
 
-(defn start-lispy-chat-server [& args])
-
 (def chat-channel (ref ()))
 (defn send-msg [msg]
   (enqueue @chat-channel (str "iyye> " msg)))
 
-(def lispy-chat-IO (bios/create-IO "lispy-chat" start-lispy-chat-server (bios/create-InputSources false []) (bios/->OutputActuators false [send-msg])))
-(dosync (alter bios/AvatarsIOList conj lispy-chat-IO))
-
-(def lispy-chat-process-input (partial bios/process-input lispy-chat-IO))
 
 (defn chat-init [ch])
 (defn chat-handler [ch room]

(defn start-lispy-chat-server [& args]
  "Main thread for the server which starts an async server with
  all the routes we specified and is websocket ready."
  (start-http-server (wrap-ring-handler app-routes)
                     {:host "localhost" :port 8080 :websocket true}))

; move to iyye!
(defn chat-init [ch]
  "register callback for receive msg"
  (receive-all ch lispy-chat-process-input))

      (ref-set chat-channel ch)
      (chat-handler ch "iyye"))
    (enqueue ch (wrapped-sync-app request))))

(defroutes app-routes
           "Routes requests to their handler function. Captures dynamic variables."
           (GET ["/chat/iyye"] {}
