Skip to content

savagematt/clj-pgnotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clj-pgnotify

Wraps Postgres pg_notify in core.async channels

Usage

(with-open [listener-cnxn (sql/get-connection @db)]
  (let [sub (listen! (pg-listener ["my_channel"])
                     listener-cnxn)]

    (sql/with-db-transaction [cnxn @db]
      (pg-notify! cnxn "my_channel" "hello"))

    (<!! sub)
    ;=> [{:channel "my_channel" :payload "hello"}]
    ))

For more advanced usage, see documentation on pg-listener.

License

Copyright © 2015 Matt Savage

Distributed under the Eclipse Public License either version 1.0 or (at your discretion) any later version.

About

Wraps Postgres pg_notify in Clojure core.async channels

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published