    "atake"
    {:beg (fn [vis actx args]
            (let [[ch] args]
-             (swap! vis #(assoc-in % [:actxs actx :wait-chs ch] :take))))
+             (swap! vis #(assoc-in % [:actxs actx :wait-chs ch] :take))
+             (swap! vis #(update-in % [:chs ch]
+                                    (fn [v]
+                                      (if (nil? v)
+                                        {:id ((:gen-id @vis)) :msgs {}}
+                                        (assoc-in v [:msgs msg] true)))))))
     :end (fn [vis actx args]
            (let [[ch result] args]
              (swap! vis #(dissoc-in % [:actxs actx :wait-chs ch]))))}
    "aput"
    {:beg (fn [vis actx args]
            (let [[ch msg] args]
-             (swap! vis #(assoc-in % [:actxs actx :wait-chs ch] :put))))
+             (swap! vis #(assoc-in % [:actxs actx :wait-chs ch] :put))
+             (swap! vis #(update-in % [:chs ch]
+                                    (fn [v]
+                                      (if (nil? v)
+                                        {:id ((:gen-id @vis)) :msgs {msg true}}
+                                        (assoc-in v [:msgs msg] true)))))))
     :end (fn [vis actx args]
            (let [[ch msg result] args]
              (swap! vis #(dissoc-in % [:actxs actx :wait-chs ch]))))}

    "no actx"))

(defn vis-init [cmds cmd-handlers]
  (let [vis (atom {:actxs {} ; {actx -> {:children {}, :wait-chs {}}}.
                   :chs {}}) ; {ch -> [ msgs... ]}.
        max-inflight (atom 10)
        event-delay (atom 0)
        event-ch (chan)
        last-id (atom 0)
        root-actx (atom nil)
        w [{:gen-id #(swap! last-id inc)
            :event-ch event-ch}]]
    (go-loop [num-events 0]
      (let [tdv @event-delay]
        (when (> tdv 0)

      ["<div>" (string/join ":" (last actx))
       (if (not-empty wait-chs)
         [" -- waiting: ("
          (map (fn [kv]
                 (let [[ch wait-kind] kv]
                   [(:id (get (:chs vis) ch)) wait-kind ", "]))
               wait-chs)
          ")"]
         [])
       "<ul>"
