 
 
        
-		    +		    

                              )))
	      )))

(defn exception-listener [write-lock-ch v {:keys [internal-error-ch]}]
  "Returns a GenericFutureListener instance
   that on completion checks the Future, if any exception
   an error is sent to the error-ch"
  (reify GenericFutureListener
    (operationComplete [this f]
       ;(go (>! write-lock-ch 1)) ;release write lock

       

(defn start-client 
  "Start a Client instance with read-ch, write-ch and internal-error-ch"
  ([host port {:keys [group read-group
                      channel-options read-ch internal-error-ch error-ch write-ch handlers reconnect-count closed] :as conf 
                                 :or {
                                      reconnect-count (AtomicInteger. (int 0))
                                      closed (AtomicBoolean. false)
                                      read-ch (chan 1000) internal-error-ch (chan 100) error-ch (chan 100) write-ch (chan 1000)}}]
  (try
  (let [g (if group group (NioEventLoopGroup. (get-default-threads)))
        b (Bootstrap.)]
