Use Clojure cells or add an observer for a reactive program?

I want to use many reactive type (data stream) programming methods in my clojure program. Uses the "add-watcher" in clojure refs to be good enough to do this. A simple case for this would be to update the GUI when changing the underlying data.

+3
source share
1 answer

Yes, this is a really good idea. I used it in my own code to update user interface elements when changing streaming data. The only thing you need to be careful about is that observers are called synchronously in the stream agentor main stream if atom, refor var. Therefore, to avoid blocking the flow, do not do too much processing in the watchers. If you need to do this, create one future.

+2
source

Source: https://habr.com/ru/post/1783191/


All Articles