This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-04
Channels
- # announcements (1)
- # babashka (41)
- # beginners (124)
- # cider (8)
- # clj-kondo (25)
- # cljs-dev (40)
- # clojars (4)
- # clojure (92)
- # clojure-europe (35)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-uk (91)
- # clojuredesign-podcast (8)
- # clojurescript (41)
- # code-reviews (1)
- # cursive (11)
- # data-science (1)
- # datascript (76)
- # datomic (45)
- # emacs (4)
- # etaoin (3)
- # events (1)
- # figwheel-main (2)
- # fulcro (9)
- # graalvm (1)
- # jackdaw (6)
- # jobs (1)
- # jobs-discuss (3)
- # kaocha (4)
- # malli (25)
- # off-topic (42)
- # pathom (4)
- # reitit (11)
- # releases (2)
- # reveal (1)
- # shadow-cljs (53)
- # sql (4)
- # tools-deps (190)
- # vrac (19)
- # xtdb (6)
Good morning
I have difficulties choosing names, I would like your opinion: 1. compute node / computation node / other 2. render node / rendering node / other 3. subscriber tree / subscription tree / other
Maybe some more fluent in English that I am could weight in. @yogthos: any suggestion ?
@yogthos a last one: diff-propagation / propagate-diff / .. something else? (itβs a fn which finds the subscribers to update, based on the subcriber tree and a diff)
I changed my function from yesterday, now it takes into account the 2nd param for key-based subscriptions - the value to return when the data is missing.
;; Testing
#_ (-> empty-subscription-tree
(subscribe-on-path [:user :first-name] 1 :not-found)
(subscribe-on-path [:user :last-name] 2 nil))
; => {:children {:user {:children {:first-name {:subscribers {1 :not-found}}
; :last-name {:subscribers {2 nil}}}}}}
#_ (-> *1
(unsubscribe-from-path [:user :first-name] 1)
(unsubscribe-from-path [:user :last-name] 2))
; => {}
Current progress on the propagate-diff
function:
(ns vrac.compute
(:require [diffuse.helper :as h]))
; ...
(def current-subscriber-tree (-> empty-subscription-tree
(subscribe-on-path [:user :first-name] 1 :not-found)
(subscribe-on-path [:user :last-name] 2 nil)
(subscribe-on-path [:user] 3 :nobody)))
(propagate-diff current-subscriber-tree
(h/map-dissoc :user))
; => [[{3 :nobody} {:type :missing}] [{1 :not-found} {:type :missing}] [{2 nil} {:type :missing}]]
(propagate-diff current-subscriber-tree
(h/map-update :user (h/map-dissoc :first-name)))
; => [[{3 :nobody} {:type :map, :key-op {:first-name :dissoc}}] [{1 :not-found} {:type :missing}]]
(propagate-diff current-subscriber-tree
(h/map-update :user (h/map-assoc :first-name "Coco")))
; => [[{3 :nobody} {:type :map, :key-op {:first-name [:assoc "Coco"]}}] [{1 :not-found} {:type :value, :value "Coco"}]]
(propagate-diff current-subscriber-tree
(h/map-update :user (h/map-assoc :last-name "the cat")))
; => [[{3 :nobody} {:type :map, :key-op {:last-name [:assoc "the cat"]}}] [{2 nil} {:type :value, :value "the cat"}]]
β End of my morning Vrac dev routine. Suggestions are welcome, as always.
@yogthos I just finished implementing the propagate-diff
function. Next, I will see what I can do about the compute graph. I will be happy to get your help in this area. See you tomorrow.
https://github.com/green-coder/vrac/commit/5b929950350128adaf1126a610e6338748bc82de
Thx !!
one question is there any chance of collisions with keys in here {:children {:user {:children {:first-name {:subscribers {1 :not-found}}}}}}
no chance of key collisions, they operate at different depth.
Side note: I updated the Diffuse library to include the missing h/missing
diff type