 ;        (doseq [user-context (map :user-context (vals task-datas))]
 ;          (doseq [hook (.getHooks user-context)]
 ;            (.cleanup hook)))
-;        (when @(:open-or-prepare-was-called? executor-data)
-;          (doseq [obj (map :object (vals task-datas))]
-;            (close-component executor-data obj)))
+        (when @(:open-or-prepare-was-called? executor-data)
+          (doseq [obj (map :object (vals task-datas))]
+            (close-component executor-data obj)))
         (log-message "Shut down executor " component-id ":" (pr-str executor-id)))
         )))
;
;
;(defmulti mk-executor-stats executor-selector)
;(defmulti close-component executor-selector)
;
;
;(defn throttled-report-error-fn [executor]



;; Stuff below here should be ok

(defn executor-selector [executor-data & _] (:type executor-data))

(defmulti close-component executor-selector)
(defmulti mk-threads executor-selector)


(defmethod close-component :spout [executor-data spout]
  (.close spout))


(defmethod close-component :bolt [executor-data bolt]
  (.cleanup bolt))


(defn throttled-report-error-fn [executor]
