Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstraction leak fix #445

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/taoensso/sente/server_adapters/community/undertow.clj
Expand Up @@ -54,11 +54,11 @@

ISenteUndertowAjaxChannel
(ajax-read! [sch]
(let [{:keys [ajax-resp-timeout-ms ajax-resp-timeout-val]}
(let [{:keys [ajax-resp-timeout-ms]}
adapter-opts]

(if ajax-resp-timeout-ms
(deref resp-promise_ ajax-resp-timeout-ms ajax-resp-timeout-val)
(deref resp-promise_ ajax-resp-timeout-ms nil)
(deref resp-promise_)))))

(defn- ajax-ch [{:keys [on-open on-close]} adapter-opts]
Expand Down Expand Up @@ -87,18 +87,12 @@

(defn get-sch-adapter
"Returns an Undertow ServerChanAdapter. Options:
:ajax-resp-timeout-ms ; Max msecs to wait for Ajax responses (default 60 secs)
:ajax-resp-timeout-val ; Value returned in case of above timeout
; (default `:undertow/ajax-resp-timeout`)"
:ajax-resp-timeout-ms ; Max msecs to wait for Ajax responses (default 60 secs)"
([] (get-sch-adapter nil))
([{:as opts
:keys [ajax-resp-timeout-ms
ajax-resp-timeout-val]

:or {ajax-resp-timeout-ms (* 60 1000)
ajax-resp-timeout-val :undertow/ajax-resp-timeout}}]
:keys [ajax-resp-timeout-ms]
:or {ajax-resp-timeout-ms (* 60 1000)}}]

(UndertowServerChanAdapter.
(assoc opts
:ajax-resp-timeout-ms ajax-resp-timeout-ms
:ajax-resp-timeout-val ajax-resp-timeout-val))))
:ajax-resp-timeout-ms ajax-resp-timeout-ms))))