You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the aleph adapter returns a manifold Deferred response and ring middleware (such as ring.middleware.session) cannot work with such a value. Changing this deftype to:
(deftypeAlephAsyncNetworkChannelAdapter []
i/IServerChanAdapter
(ring-req->server-ch-resp [sch-adapter ring-req callbacks-map]
(let [{:keys [on-open on-close on-msg _on-error]} callbacks-map
ws? (websocket-req? ring-req)]
(if-let [s (and ws? (try @(aleph/websocket-connection ring-req)
(catch Exception e
nil)))]
(do
(when on-msg (s/consume (fn [msg] (on-msg s ws? msg)) s))
(when on-close (s/on-closed s (fn [] (on-close s ws? nil))))
(when on-open (do (on-open s ws?)))
{:body s})
(let [s (s/stream)] ; sch
(when on-close (s/on-closed s (fn [] (on-close s ws? nil))))
(when on-open (do (on-open s ws?)))
{:body s})))))
seems to work, but someone more qualified should take a better look
The text was updated successfully, but these errors were encountered:
@g7s Hi Gerasimos, thanks for pinging about this.
Unfortunately I'm not familiar with the Aleph API or possible tradeoffs with this change.
Since it's been a few years and no one else has given any input, I'll just incorporate your suggestion in the next pre-release and if anyone has any issues then we can revert.
Currently the aleph adapter returns a manifold
Deferred
response and ring middleware (such asring.middleware.session
) cannot work with such a value. Changing this deftype to:seems to work, but someone more qualified should take a better look
The text was updated successfully, but these errors were encountered: