Skip to content

Commit

Permalink
Update to beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrossley3 committed Feb 10, 2015
1 parent 84a821b commit 545dcf4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
20 changes: 6 additions & 14 deletions project.clj
Expand Up @@ -4,24 +4,16 @@
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.immutant/immutant "2.x.incremental.444"]

;; or bring the artifacts in piecemeal:
;; [org.immutant/caching "2.x.incremental.444"]
;; [org.immutant/messaging "2.x.incremental.444"]
;; [org.immutant/scheduling "2.x.incremental.444"]
;; [org.immutant/web "2.x.incremental.444"]

[compojure "1.1.8"]
[ring/ring-core "1.3.0"]
[ring/ring-devel "1.3.0"]
[org.immutant/immutant "2.0.0-beta2"]
[compojure "1.3.1"]
[ring/ring-devel "1.3.1"]
[org.clojure/core.memoize "0.5.6"]
[clj-time "0.7.0"]
[cheshire "5.3.1"]
[clj-time "0.9.0"]
[cheshire "5.4.0"]
[environ "1.0.0"]]
:repositories [["Immutant incremental builds"
"http://downloads.immutant.org/incremental/"]]
:plugins [[lein-immutant "2.0.0-alpha2"]]
:plugins [[lein-immutant "2.0.0-beta1"]]
:main demo.core
:uberjar-name "demo-standalone.jar"
:profiles {:uberjar {:aot [demo.core]}}
Expand Down
10 changes: 2 additions & 8 deletions src/demo/web.clj
Expand Up @@ -26,19 +26,13 @@

(defn sse-countdown
[request]
(sse/as-sse-channel request
(sse/as-channel request
{:on-open (fn [ch]
(doseq [x (range 5 0 -1)]
(sse/send! ch x)
(Thread/sleep 500))
;; Signal the client to call EventSource.close()
(sse/send! ch {:event "close", :data "bye!"})
;; The above won't actually close the channel, so we
;; introduce a race condition by explicitly closing it
;; below. If the channel closes before the EventSource
;; closes, it'll reconnect and we do it all over again!
(.close ch))
:on-close (fn [& _] (println "SSE channel closed"))}))
(sse/send! ch {:event "close", :data "bye!"}))}))

(defroutes routes
(GET "/" {c :context} (redirect (str c "/index.html")))
Expand Down

0 comments on commit 545dcf4

Please sign in to comment.