This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.
publish message to foo channel from user nickname.
$ python pub.py foo nickname
PUBLISH to channel #foo
| (ns user | |
| (:require [clojure.java.io :as io] | |
| [datomic.api :as d])) | |
| (defn order-schema [] | |
| (read-string (slurp (io/resource "schema.edn")))) | |
| (defn start-datomic! [uri schema] | |
| (d/create-database uri) | |
| (let [conn (d/connect uri)] |
Links for essays ref'd in http://blog.fogus.me/2009/03/11/seven-books/
| (ns datomic-helpers | |
| (:require [datomic.api :as d])) | |
| ;;; Expose Datomic vars here, for convenience | |
| ;;; Ring middleware | |
| (defn wrap-datomic | |
| "A Ring middleware that provides a request-consistent database connection and | |
| value for the life of a request." |