Skip to content

Instantly share code, notes, and snippets.

@gszeliga
Created December 3, 2017 17:46
Show Gist options
  • Save gszeliga/596d4d05f2fd4d73130c0332040010d4 to your computer and use it in GitHub Desktop.
Save gszeliga/596d4d05f2fd4d73130c0332040010d4 to your computer and use it in GitHub Desktop.
(defn stream-lines-from [path]
(let [c (chan 1024)]
(go
(with-open [rdr (io/reader path)]
(doseq [line (line-seq rdr)]
(>! c line)))
(close! c))
c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment