 (defn- build-verticle
   [{:keys [on-start on-stop on-error]
     :or {on-error (constantly nil)
-         on-stop (constantly nil)}}]
+         on-stop (constantly nil)}
+    :as options}]
   (let [vsm (volatile! nil)
         ctx (volatile! nil)
         lst (volatile! nil)]

  promise execution chain."
  ([prm] (handle-on-context prm (current-context)))
  ([prm ctx]
   (let [d (p/deferred)]
     (p/finally prm (fn [v e]
                      (.runOnContext

                                      (p/resolve! d v)))))))
     d)))

(defn run-on-context
  [ctx f]
  (.runOnContext
   ^Context ctx
   ^Handler (reify Handler
              (handle [_ v']
                (f ctx)))))

(s/def :vertx.core$verticle/on-start fn?)
(s/def :vertx.core$verticle/on-stop fn?)
(s/def :vertx.core$verticle/on-error fn?)
