 (deftype WebSocketSession [in out ctrl context handler]
   java.io.Closeable
   (close [_]
+    (a/put! ctrl :close)
     (a/close! in)
     (a/close! out)
     (a/close! ctrl))

    (a/put! in (.getData msg) (fn [_] (.execute callback nil))))

  (^void onClose [this]
    (a/put! ctrl :close)
    (.close this)))

(defn websocket

          (do
            (a/<! (send! ws (str value)))
            (recur))
          (do
            (.close ws)
            (.close this))))
      (handler (merge context
                      {:in in :out out :ctrl ctrl
                       :ws ws :wssession this}))))
