   (bytebuffer [s]
     (Unpooled/wrappedBuffer (.getBytes s "UTF-8"))))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Promissum IFuture protocol implementation
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; TODO: deprecate this because the implementation is wrong.
+
 (extend-protocol pt/IFuture
   ratpack.exec.Promise
   (map [this callback]
-    (.then ^Promise this (action callback))
+    (.then ^Promise this (fn->action callback))
     this)
   (flatmap [this callback]
     (throw (UnsupportedOperationException. "Not implemented")))
   (error [this callback]
-    (.onError ^Promise this (action callback))
+    (.onError ^Promise this (fn->action callback))
     this))

           ratpack.func.Function
           ratpack.func.Block
           ratpack.exec.Promise
           ratpack.handling.Context
           io.netty.buffer.Unpooled))

(defn action
  "Coerce a plain clojure function into
  ratpacks's Action interface."
  [callable]

    (^void execute [_ x]
      (callable x))))

(defn ^Block fn->block
  "Coerce a plain clojure function into
  ratpacks's Block interface."
  [callable]
