Skip to content
This repository
Browse code

match lamina connection callback key name change

  • Loading branch information...
commit f0f68c79990fc8817639fb6e11d0238c831b3ba7 1 parent 1681caa
Max Penet mpenet authored

Showing 1 changed file with 5 additions and 11 deletions. Show diff stats Hide diff stats

  1. +5 11 src/aleph/redis.clj
16 src/aleph/redis.clj
@@ -31,7 +31,7 @@
31 31 :description (str "redis @ " (:host options) ":" (:port options))}
32 32 options)
33 33 database (atom nil)
34   - connection-callback (fn [ch]
  34 + on-connected (fn [ch]
35 35 (run-pipeline nil
36 36 (fn [_]
37 37 (when-let [password (:password options)]
@@ -42,20 +42,20 @@
42 42 (enqueue ch [:select db])
43 43 (read-channel ch)))
44 44 (fn [_]
45   - (when-let [callback (:connection-callback options)]
  45 + (when-let [callback (:on-connected options)]
46 46 (callback ch)))))
47 47 client-fn (pipelined-client
48 48 #(tcp-client (merge options {:frame (redis-codec (:charset options))}))
49 49 (merge
50 50 options
51   - {:connection-callback connection-callback}))]
  51 + {:on-connected on-connected}))]
52 52 (fn [& args]
53 53 (let [result (apply client-fn args)]
54 54 (when (and (coll? (first args)) (= :select (ffirst args)))
55 55 (run-pipeline result
56 56 {:error-handler (fn [_] )}
57 57 (fn [_] (reset! database (-> args first second)))))
58   - result)))))
  58 + result)))))
59 59
60 60 (defn enqueue-task
61 61 "Enqueues a task onto a Redis queue. 'task' must be a printable Clojure data structure."
@@ -107,7 +107,7 @@
107 107 {:name "redis"
108 108 :description (str "redis stream @ " (:host options) ":" (:port options))}
109 109 options
110   - {:connection-callback
  110 + {:on-connected
111 111 (fn [ch]
112 112 ;; NOTE: this is a bit of a race condition (subscription messages
113 113 ;; may be sent twice), but subscription messages are idempotent.
@@ -150,9 +150,3 @@
150 150 to the PUNSUBSCRIBE command."
151 151 [redis-stream & stream-patterns]
152 152 (enqueue redis-stream (list* "punsubscribe" stream-patterns)))
153   -
154   -
155   -
156   -
157   -
158   -

0 comments on commit f0f68c7

Please sign in to comment.
Something went wrong with that request. Please try again.