Skip to content

Commit

Permalink
[mod] [Undertow adapter] close! now returns true iff actually closed
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Mar 7, 2023
1 parent 2a91ad4 commit 318e90a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/taoensso/sente/server_adapters/undertow.clj
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@
(sch-send! [sch websocket? msg] (async/put! resp-ch msg (fn [_] (i/sch-close! sch))))
(sch-open? [sch] @open?_)
(sch-close! [sch]
(when on-close (on-close sch false nil))
(reset! open?_ false)
(async/close! resp-ch))
(when (compare-and-set! open?_ true false)
(when on-close (on-close sch false nil))
(async/close! resp-ch)
true))

ISenteUndertowAjaxChannel
(ajax-read! [sch] (async/<!! resp-ch)))
Expand Down

0 comments on commit 318e90a

Please sign in to comment.