Skip to content

Commit

Permalink
Avoid race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrossley3 committed Feb 6, 2015
1 parent abc972b commit 017c713
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions web/src/immutant/web/sse.clj
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@

(defn send!
"Formats an event according to the SSE spec and sends it
via [[immutant.web.async/send!]] with an optional on-complete
callback"
via [[immutant.web.async/send!]]"
([ch event]
(send! ch event nil))
([ch event options]
Expand Down
3 changes: 2 additions & 1 deletion web/test/immutant/web/sse_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
(.open client)
(is (= :success (deref closed 5000 :fail)))
(is (not (.isOpen client)))
(is (= ["5" "4" "3" "2" "1" :done "bye!"] @result))
(is (= ["5" "4" "3" "2" "1"] (take 5 @result)))
(is (= #{:done "bye!"} (set (drop 5 @result))))
(stop server)))

0 comments on commit 017c713

Please sign in to comment.