make-channel-socket!
and you're good to go.This looks great! can't wait to try it out.
Well done.
Thanks. Can you compare sente with chord?
I'm trying to learn Sente using the LightTable browser connected repl.
From the JS console, I see repeated, failed attempts to connect the server.
Taking a very quick look at the source for the CLJS make-channel-socket!, it seems that it tries to resolve the url using the CLJS chsk-url function which, in turn, uses encore/get-window-location.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/5J4L8pbGwGU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
and that necessitated delivering my HTML through http-kit rather than the shortcut of reading it from the file system using file://...
Once I did that, an assertion nicely documented the use of chsk-send! (thanks for that!). One small thing that tripped me up: It seems the event id must be a namespaced keyword. I haven't thoroughly rtfm yet so if that's doc'd, bad on me.
it doesn't look like the list of all connected users is available in the API.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hey Peter,I like the UUID feature, but it doesn't look like the list of all connected users is available in the API. How would you do a global broadcast to all connected clients using Sente? I'm having trouble figuring out how to write a chat demo using Sente.Thanks for your work!
On Wednesday, February 26, 2014 6:57:24 AM UTC-7, Peter Taoussanis wrote:
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi folks,Quick post to announce a new lib release: https://github.com/ptaoussanis/senteFrom the README:Sente is small client+server library that makes it easy to build reliable, high-performance realtime web applications with Clojure.* Bidirectional a/sync comms over both WebSockets and Ajax (auto-selecting).* Robust: auto keep-alives, buffering, mode fallback, reconnects.* edn rocks. So send edn, get edn: no json here.* Tiny, simple API:make-channel-socket!
and you're good to go.* Automatic, sensible support for users connected with multiple clients and/or devices simultaneously.* Flexible model: use it anywhere you'd use WebSockets or Ajax.* Fully documented, with examples (more forthcoming).* Small: less than 600 lines of code for the entire client+server implementation.* Supported servers: currently only http-kit, but easily extended.---Have been using something like this in production since a little after core.async came out, and wouldn't want to go back. Note that I tweaked a few things for the public release so there may be some rough edges initially.An example project's included (new as of today) and there's a Leiningen alias configured to handle all the fiddly bits like getting the Cljx and Cljs to compile: just download, `lein start-dev` at a terminal, and you're good to go.Any questions/problems/whatever, you can reach me here or on GitHub.That's it! Happy hacking, cheers! :-)- Peter Taoussanis
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
So yeah, I think that exposing a list will get us pretty far. The missing piece, then, would be the ability for a a client to send a connection request for a specific channel.
I'll be honest I'm a little hesitant to add any kind of room/subscription facilities to Sente itself...
My thinking currently goes:
* Far as I can tell (?), this is always _very_ easy to do application-side.
* Doing it application-side gives a lot more flexibility. For example, what if you've got multiple servers and want a distributed/db-backed subscription index?
* For general hygiene I prefer keeping state (like subscriptions) separate from the comms mechanism itself. Keeping subscription info in Sente makes it tricky to get to if you want to do something unexpected with it. When you control the shape+location of the relevant data/atom(s), you're free to use it and bash on it however you like.
Instead, I'd propose to just expose a set of currently-connected uids. You can then intersect that set against any subscription/channel logic you may have.
Having said all that, I'm not sure what Socket.IO's rationale was when they chose to bundle subscription semantics into the core API so I might well be missing something...
Yes, thanks for Sente, Peter!
Will Sente eventually use/support Transit? :-)