Sente works really well, I am using it in the Clojure rewrite of an application and I am using it to call functions on the server from the client by putting messages on core.async channels. I am even using it to get around the current limitation on the ClojureScript side that there's no *pprint* implementation (yet). Instead, I send my data structure for visual inspection to the server during the development process and have that pretty print to the console. Sounds like a hack but works really well. Here's the source code of that project: github.com/matthias/BirdWatch
However, *@Mikera* I don't really think you want synchronous function invocation. You send messages and then move on and at some point, a result comes back. Why would you want to wait for anything to finish when you do not have the wire under control? *@Shaun* I don't think a client can ever be trusted enough to allow it to send arbitrary code for evaluation to the server. The idea alone makes me cringe, just like eval() in JavaScript does. Cheers, Matthias On Thursday, September 11, 2014 3:06:26 PM UTC+2, Shaun Robinson wrote: > > Check out Sente. It meets all your requirements. EDN is used as a > transport mechanism, with experimental support for Transit -- but these are > really implementation details. Values sent from the client shows up in tact > on the server, and vice versa. > > https://github.com/ptaoussanis/sente > > * Sente provides a send function and a core.async channel on both the > Clojure and Clojurescript sides. > * Any value sent via the client's send function shows up on the server's > channel intact, and vice versa > * The server keeps an atom of connected clients, and a message from the > server can target one or all of them > * The excellent core.match is commonly used for pattern matching messages > on the client and server sides and dispatching functions > * There is robust support for re-connecting > * The software is mature, and terse (~1000 lines). I've used it as a comms > layer in several production apps with great success. > * Regarding remote function serialization / invocation, assuming you trust > your client, you could pass a function from client->server as data, and > invoke it on the server side. No need for serialization, normal 'quoting' > would work. > > - Shaun > > On Wednesday, September 10, 2014 1:39:24 AM UTC-4, Mikera wrote: >> >> I've encountered a couple of use cases where it would helpful to have >> some form of remote function invocation in Clojure/ClojureScript with the >> following characteristics: >> - Arbitrary functions can be effectively "serialised" and sent to remote >> machines >> - Remote functions can be invoked either synchronously or asynchronously >> - Parameters get passed as serialised values, which might in turn be >> other functions >> - Works across Clojure/ClojureScript boundary >> - Would need to allow for various error conditions (network failure etc.) >> >> Could this be achieved in a reasonably sane way with some combination of >> Transit and/or core.async? Has anyone tried this? >> > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.