     vertex))
 
 (defn execution-result
-  [p t0 colls sigs]
-  (deliver
-   p {:collections colls
-      :signals     sigs
-      :time        (* (- (System/nanoTime) t0) 1e-6)}))
+  [type p colls sigs t0 & [opts]]
+  (->> {:collections colls
+        :signals     sigs
+        :type        type
+        :time        (* (- (System/nanoTime) t0) 1e-6)}
+       (merge opts)
+       (deliver p)))
 
 (defn async-context
   [opts]

(def default-context-opts
  {:collect-thresh 0
   :signal-thresh  0
   :timeout        100
   :max-ops        1e6})

(defn vertex

                (let [t (timeout max-t)
                      [[evt v ex] port] (alts! [ctrl t])]
                  (if (= port t)
                    (execution-result :converged res colls sigs t0)
                    (case evt
                      :collect (recur (inc colls) sigs)
                      :signal  (recur colls (inc sigs))
                      :error   (do (warn ex "@ vertex" v)
                                   (execution-result
                                    :error res colls sigs t0
                                    {:reason           :error
                                     :reason-exception ex
                                     :reason-vertex    v}))
                      (do (info "wrong event" evt v)
                          (execution-result
                           :interrupted res colls sigs t0
                           {:reason        :unknown
                            :reason-event  evt
                            :reason-vertex v})))))
                (execution-result :terminated res colls sigs t0))))
          res)))))

(def g (compute-graph))
