Skip to content

Commit

Permalink
removed unnecessary reference to keys in generate-event
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniogarrote committed Jan 3, 2011
1 parent ed09cbf commit 5d41b32
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject clj-s4 "0.2.1.1-SNAPSHOT"
(defproject clj-s4 "0.2.1.2-SNAPSHOT"
:description "A library to build Yahoo S4 applications using Clojure"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
Expand Down
2 changes: 1 addition & 1 deletion sampleapps/random-numbers/src/randomnumbers/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
(loop [num (int (Math/floor (* (rand) 100)))]
(generate-event this
(read-state this :stream)
(cljs4.Number. {:num num}) [(mod num 10)])
(cljs4.Number. {:num num}))
(Thread/sleep 3000)
(recur (int (Math/floor (* (rand) 100)))))))
3 changes: 2 additions & 1 deletion sampleapps/wordcount/src/wordcount/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
:init (fn [this]
(let [acum {}]
(write-state this :acum acum)))

:process-event [[Object] (fn [this token]
(let [token-map (msg-to-map token)]
(write-state this :textId (:textId token-map))
Expand Down Expand Up @@ -101,7 +102,7 @@

:run (fn [this]
(loop [text (random-text)]
(generate-event this (:stream (deref (.state this))) (cljs4.Text. {:content text :id (gen-uuid)}) [(read-state this :stream)])
(generate-event this (:stream (deref (.state this))) (cljs4.Text. {:content text :id (gen-uuid)}))
(Thread/sleep 10000)
(recur (random-text)))))

7 changes: 3 additions & 4 deletions src/clj_s4/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,10 @@
Arguments:
- adapter: the adapter object
- stream : a string containing the name of the stream where the event will be inserted
- event: a object containing data for the event
- keys: a list of keys for the event"
([adapter stream event keys]
- event: a object containing data for the event"
([adapter stream event]
(let [handlers (:handlers (deref (.state adapter)))
wrapper (io.s4.collector.EventWrapper. stream event keys)]
wrapper (io.s4.collector.EventWrapper. stream event nil)]
(doseq [handler handlers]
(try
(.processEvent handler wrapper)
Expand Down

0 comments on commit 5d41b32

Please sign in to comment.