   (jdbc/with-connection  (db-conn-info (config :db))
     (exec-sql "SELECT now()" []))
 
-  (register-listener :test-listener (:database (config :db)) "irmgard" "example_table"
-                     (fn [recs]
-                       (log/infof "ROW CHANGE! %s" recs)))
 
   (jdbc/with-connection  (db-conn-info (config :db))
     (process-row-changes

             (catch Exception e
               ;; do nothing
               ))
            (recur conf @(:continue conf)))
          (do
            (log/infof "db-watcher[%s] terminating" dbname)))))))

(defn start-watcher [wname conf]
  (let [control-atom   (atom true)
        watcher-config {:conf     conf
                        :error    (atom nil)
                        :continue control-atom

(defn stop-watcher [name]
  (let [conf (get @db-watchers name)]
    (when conf
      (.lazySet (:continue conf) false)
      (.interrupt (:thread conf))
      (swap! db-watchers dissoc name))))

