Skip to content
This repository has been archived by the owner on Dec 19, 2020. It is now read-only.

Clojars #8

Open
bilus opened this issue Mar 6, 2015 · 2 comments
Open

Clojars #8

bilus opened this issue Mar 6, 2015 · 2 comments

Comments

@bilus
Copy link

bilus commented Mar 6, 2015

Thank you for trying to popularize BrowserChannel.

It seems that the libs haven't been pushed to clojars (clj-browserchannel-server version 0.1.0, clj-browserchannel-jetty-adapter 0.0.6). The older versions (referenced by the demo) are not compatible with ring-servlet, as you well know.

I'm trying it out now and I hope it works but had to fork it in order to use in our project.

@akhudek
Copy link
Contributor

akhudek commented Mar 6, 2015

Ah, yes, apologies, we've been slow in preparing a new release. Please do file bugs against this repo. We plan to have a new updated release soon.

@bilus
Copy link
Author

bilus commented Mar 6, 2015

For now it seems to be running, pending further tests, except callbacks
take two arguments:

(browserchannel/wrap-browserchannel {:base "/channel"
                                                                :on-session
                                                                      (fn
[session-id req]

(println "session " session-id "connected")


(browserchannel/add-listener

session-id

:close

(fn [_ reason]

(println "session " session-id " disconnected: " reason)

(swap! clients disj session-id)

(doseq [client-id @clients]

  (browserchannel/send-map client-id {"msg" (str "client " session-id "
disconnected " reason)}))))

(browserchannel/add-listener

session-id

:map

(fn [_ map]

(println "session " session-id " sent " map)

(doseq [client-id @clients]

  (browserchannel/send-map client-id map))))

(swap! clients conj session-id)

(doseq [client-id @clients]

(browserchannel/send-map client-id {"msg" (str "client " session-id "
connected")})))})

On Fri, Mar 6, 2015 at 8:23 PM, Alexander Hudek [email protected]
wrote:

Ah, yes, apologies, we've been slow in preparing a new release. Please do
file bugs against this repo. We plan to have a new updated release soon.


Reply to this email directly or view it on GitHub
#8 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants