This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn try-parse [x] | |
(try | |
(json/parse-string x true) | |
(catch Exception e | |
x))) | |
(defn lazy-test-data [] | |
"Returns a channel that reads json maps line by line from mock_data.json " | |
(let [channel (chan 5 (map try-parse))] | |
(future (with-open [rdr (clojure.java.io/reader "resources/mock_data.json")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Executing before task -=___ Peer 1 starts task/job and batch | |
Executing before batch -=__/ Segments are loaded through the :core.async/read-from-chan :in | |
Executing after batch -=__/ | |
Executing before batch -=___ Segments are loaded into the :inc function and processed | |
Executing after batch -=__/ | |
Executing before batch -=___ Segments are loaded through the :core.async/write-to-chan :out | |
Executing after task -=___ Why does this happen *before* "Executing after batch" | |
Executing after batch -=__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns flat-workflow.functions.sample-functions) | |
(defn ^{:batch-size 10 :onyx? true} increment-age [segment] | |
(update-in segment [:age] inc)) | |
(defn ^{:batch-size 10 :onyx? true} legal? | |
"hello world" | |
[age segment] | |
age) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns statefunction.web | |
(:require [compojure.core :refer [defroutes GET PUT POST DELETE ANY]] | |
[compojure.handler :refer [site]] | |
[compojure.route :as route] | |
[clojure.java.io :as io] | |
[ring.middleware.stacktrace :as trace] | |
[ring.middleware.session :as session] | |
[ring.middleware.session.cookie :as cookie] | |
[ring.adapter.jetty :as jetty] | |
[ring.middleware.basic-authentication :as basic] |
NewerOlder