This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-10
Channels
- # announcements (4)
- # babashka (29)
- # beginners (15)
- # calva (4)
- # cljs-dev (1)
- # clojure (28)
- # clojure-dev (13)
- # clojure-europe (3)
- # clojure-india (1)
- # clojure-spec (7)
- # clojure-uk (5)
- # clojurescript (37)
- # component (2)
- # conjure (60)
- # cursive (2)
- # datomic (1)
- # emacs (1)
- # figwheel-main (18)
- # fulcro (38)
- # graalvm (6)
- # graphql (13)
- # helix (14)
- # jobs-discuss (1)
- # joker (5)
- # lein-figwheel (2)
- # nrepl (3)
- # off-topic (15)
- # other-languages (1)
- # other-lisps (1)
- # pedestal (2)
- # reagent (8)
- # reitit (44)
- # shadow-cljs (83)
- # slack-help (8)
- # spacemacs (1)
I pushed a pre-release of the filewatcher pod. Compile yourself, or use the macOS pre-released binary. https://github.com/babashka/pod-babashka-filewatcher
may be i'm doing something wrong here?
user=> (require '[babashka.pods :as pods])
nil
user=> (pods/load-pod "pod-babashka-filewatcher")
nil
user=> (def chan (pod.babashka.filewatcher/watch "/tmp"))
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 13, kind: PermissionDenied, message: "Permission denied" })', src/main.rs:122:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#'user/chan
user=>
filewatcher now available on brew - also a linux binary. https://github.com/babashka/pod-babashka-filewatcher
@lilactown On the path works. But you can also give load-pod an absolute path.
Really nice work on the filewatcher pod. I did some quick tests on my Mac and it works. I don’t always understand the output. E.g. sometimes it says “create” where it’s really a file update. Maybe this is a problem of the editor i’m using (in this case textmate). I have seen this behaviour with other filewatchers too. Some changes are instantly reported, some are delayed. I’m curious what the cause is of this. Given similar behaviour with the other file watchers, I’m assuming this doesn’t have anything to do with your code, might be an OSX thing
It's using this library: https://github.com/notify-rs/notify There is a 2 second delay, pre-configured. And events are debounced.
You could try to tweak the Rust code and see if that helps. And/or try to watch a directory that you are manually editing, not from the editor
Thank you, I will do some tweaking. For my own polling approach I’ve set a 50ms delay so it feels instant, but that does take more CPU. Reading the notify
docs it sounds like filesystem restrictions might also force to go back to polling. I didn’t realize how complicated filewatching was 🙈
Does the Rust + Pod combination allow to move the configuration of the notify library to Babashka or are those compile time parameters?
Sounds good. I saw there are many other options. I think I would need to study this. I don’t understand all it’s usecases 🙈
Also in v5 they are making a lot of breaking changes to their API so I'm not sure what's going to be next 😉
Also: I'd like to add an unwatch function, maybe. But my Rust isn't that advanced yet...
It looks pretty advanced to me 😅