Skip to content

Commit

Permalink
Switch to direct record field access
Browse files Browse the repository at this point in the history
Also remove temporary controller loading debug println.
  • Loading branch information
seancorfield committed Nov 17, 2016
1 parent 9206576 commit d5c4cfe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion resources/fw1.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.1
0.10.2
24 changes: 12 additions & 12 deletions src/framework/one.clj
Original file line number Diff line number Diff line change
Expand Up @@ -668,33 +668,33 @@
http-server shutdown] ; state
component/Lifecycle
(start [this]
(if (:http-server this)
(if http-server
this
(let [start-server (case (:server this)
(let [start-server (case server
:jetty (do
(require '[ring.adapter.jetty :as jetty])
(resolve 'jetty/run-jetty))
:http-kit (do
(require '[org.httpkit.server :as kit])
(resolve 'kit/run-server))
(throw (ex-info "Unsupported web server"
{:server (:server this)})))]
{:server server})))]
(assoc this
:http-server (start-server ((:handler-fn this) application)
(cond-> {:port (:port this)}
(= :jetty (:server this))
:http-server (start-server (handler-fn application)
(cond-> {:port port}
(= :jetty server)
(assoc :join? false)))
:shutdown (promise)))))
(stop [this]
(if (:http-server this)
(if http-server
(do
(case (:server this)
:jetty (.stop (:http-server this))
:http-kit ((:http-server this))
(case server
:jetty (.stop http-server)
:http-kit (http-server)
(throw (ex-info "Unsupported web server"
{:server (:server this)})))
{:server server})))
(assoc this :http-server nil)
(deliver (:shutdown this) true))
(deliver shutdown true))
this)))

(defn web-server
Expand Down

0 comments on commit d5c4cfe

Please sign in to comment.