             NginxRequest NginxHttpServerChannel ChannelListener
             AppEventListenerManager AppEventListenerManager$Listener
             AppEventListenerManager$Decoder AppEventListenerManager$PostedEvent
-            MessageAdapter])
+            MessageAdapter WholeMessageAdapter])
   (:import [nginx.clojure.net NginxClojureAsynChannel NginxClojureAsynChannel$CompletionListener
             NginxClojureAsynSocket])
   (:import [nginx.clojure.clj Constants])

     resp is a ring Response Map, e.g. {:status 200, headers {\"Content-Type\" \"text/html\"}, :body \"Hello, Nginx-Clojure!\" } .
     ")
  (add-listener! [ch callbacks-map]
    "Add a websocket event listener.
      callbacks-map is a map whose key can be either of :on-open,:on-message,:on-close,:on-error
      the value of :on-open is a function like (fn[ch]...)
      the value of :on-message is a function like (fn[ch message remaining?]...)
      the value of :on-close is a function like (fn[ch reason]...)
      the value of :on-error is a function like (fn[ch status])
     ")

  (-> req (.handler) (.hijack req ignore-nginx-filter?)))

(defprotocol HttpServerChannel
  (closed? [ch])
  (close! [ch] 
    "Asynchronously close the channel. If there's remaining data to send it won't block 
     current thread  and will flush data on the background asynchronously and later close the channel safely")
