     (swap! request-cache #(cache/miss % request-id {:response-type response-type :handler handler}))))
 
 (defn- find-handler
-  "Look up the handler details for a request id, removing them from the cache."
+  "Look up the handler details for a request id, removing them from
+  the cache."
   [request-id request-cache]
   (when-let [entry (cache/lookup @request-cache request-id)]
     (swap! request-cache #(cache/evict % request-id))
     entry))
 
 (defn- handle-response
-  "Look up the handler associated with an OLA server response and call it on a new thread."
+  "Look up the handler associated with an OLA server response and call
+  it on a new thread."
   [wrapper request-cache]
   (if-let [handler-entry (find-handler (:id wrapper) request-cache)]
     (let [response-length (.size (:buffer wrapper))

(declare shutdown)

(defn- process-requests
  "Set up loops to read requests on our local channel and send them to the OLA server, and read its responses
  and  dispatch them to the proper handlers. Needs to be called in a future since it uses blocking reads from
  the server socket."
  [channel]

  (let [connection (atom (connect-server nil))

  nil)

(defn- connect-server
  "Establishes a new connection to the OLA server, returning the value
  the @connection atom should hold for using it. Takes the current
  connection, if any, as its argument, in case cleanup is needed."
  [conn]
  (when (:socket conn)
    (disconnect-server conn)) ;; Clean up any old connection, e.g. if a read failed
