2020-05-06 19:14:14 +00:00
|
|
|
# pod-babashka-filewatcher
|
|
|
|
|
|
|
|
|
|
## Compile
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ cargo build --release
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Run
|
|
|
|
|
|
2020-05-06 20:43:04 +00:00
|
|
|
``` clojure
|
2020-05-06 19:30:56 +00:00
|
|
|
(babashka.pods/load-pod "target/release/pod-babashka-filewatcher")
|
2020-05-06 19:14:14 +00:00
|
|
|
(def chan (pod.babashka.filewatcher/watch "/tmp"))
|
|
|
|
|
(require '[clojure.core.async :as async])
|
|
|
|
|
(loop [] (prn (async/<!! chan)) (recur))
|
|
|
|
|
;;=> ["changed" "/tmp"]
|
|
|
|
|
;;=> ["changed" "/tmp"]
|
|
|
|
|
```
|