We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b41f312 commit 810d5e6Copy full SHA for 810d5e6
Clojure-Websockets/src/clj/birdwatch/twitterclient/processing.clj
@@ -23,11 +23,13 @@
23
(defn- streaming-buffer []
24
(fn [step]
25
(let [buff (atom "")]
26
- (fn [r x]
+ (fn
27
+ ([r] (step r))
28
+ ([r x]
29
(let [json-lines (-> (str @buff x) (insert-newline) (str/split-lines))
30
to-process (butlast json-lines)]
31
(reset! buff (last json-lines))
- (if to-process (reduce step r to-process) r))))))
32
+ (if to-process (reduce step r to-process) r)))))))
33
34
(defn- tweet? [data]
35
"Checks if data is a tweet. If so, pass on, otherwise log error."
@@ -50,3 +52,7 @@
50
52
51
53
(defn ex-handler [ex]
54
(log/error "Exception while processing chunk" ex))
55
+
56
57
58
0 commit comments