ddellacosta / cljs-core-async-chat

A simple demo using httpkit and core.async to build a WebSocket-based, extremely dumb chat system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cljs-core-async-chat

A simple demo using httpkit and core.async to build a WebSocket-based, extremely dumb chat system. Uses a fair bit of domina too, I should mention.

The usual caveats in terms of browser-compatibility with WebSocket applies.

Thanks go to David Nolen for his copious examples of how to use core.async in ClojureScript (and all his work on CLJS and core.async!), as well as random help in IRC when first getting going.

Todos

  • Properly setup/teardown WebSocket connection. Kind of a lazy hack now.
  • Get core.async working with httpkit on the server side.
  • See if I can take better advantage of core.async doing DOM manipulation, among other things...

Running

Compile CLJS

lein cljsbuild once

To start a web server for the application, run:

lein run

Go to localhost:3000.

Easier to see what's going on if you open it on a few different machines on the same network (will need to configure ws-url in base.cljs), or at least a few different browsers on the same machine.

License

Distributed under the MIT License (http://dd.mit-license.org/)

Copyright © 2013 Dave Della Costa

About

A simple demo using httpkit and core.async to build a WebSocket-based, extremely dumb chat system.


Languages

Language:Clojure 53.7%Language:CSS 32.3%Language:HTML 14.1%