Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

match lamina connection callback key name change

  • Loading branch information...
commit f0f68c79990fc8817639fb6e11d0238c831b3ba7 1 parent 1681caa
@mpenet mpenet authored
Showing with 5 additions and 11 deletions.
  1. +5 −11 src/aleph/redis.clj
View
16 src/aleph/redis.clj
@@ -31,7 +31,7 @@
:description (str "redis @ " (:host options) ":" (:port options))}
options)
database (atom nil)
- connection-callback (fn [ch]
+ on-connected (fn [ch]
(run-pipeline nil
(fn [_]
(when-let [password (:password options)]
@@ -42,20 +42,20 @@
(enqueue ch [:select db])
(read-channel ch)))
(fn [_]
- (when-let [callback (:connection-callback options)]
+ (when-let [callback (:on-connected options)]
(callback ch)))))
client-fn (pipelined-client
#(tcp-client (merge options {:frame (redis-codec (:charset options))}))
(merge
options
- {:connection-callback connection-callback}))]
+ {:on-connected on-connected}))]
(fn [& args]
(let [result (apply client-fn args)]
(when (and (coll? (first args)) (= :select (ffirst args)))
(run-pipeline result
{:error-handler (fn [_] )}
(fn [_] (reset! database (-> args first second)))))
- result)))))
+ result)))))
(defn enqueue-task
"Enqueues a task onto a Redis queue. 'task' must be a printable Clojure data structure."
@@ -107,7 +107,7 @@
{:name "redis"
:description (str "redis stream @ " (:host options) ":" (:port options))}
options
- {:connection-callback
+ {:on-connected
(fn [ch]
;; NOTE: this is a bit of a race condition (subscription messages
;; may be sent twice), but subscription messages are idempotent.
@@ -150,9 +150,3 @@
to the PUNSUBSCRIBE command."
[redis-stream & stream-patterns]
(enqueue redis-stream (list* "punsubscribe" stream-patterns)))
-
-
-
-
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.