             [taoensso.timbre :as timbre :refer [info]]
             [onyx.peer.operation :as operation]
             [onyx.log.entry :refer [create-log-entry]]
-            [onyx.log.commands.task-state :refer [stop-task-state]]
             [onyx.static.default-vals :refer [defaults arg-or-default]]))
 
 (defn send-to-outbox! [{:keys [outbox-ch] :as state} reactions]

          (>!! outbox-ch entry)

          (let [outbox-loop-ch (thread (outbox-loop id log outbox-ch restart-ch))
                processing-loop-ch (thread (processing-loop id log messenger origin inbox-ch outbox-ch restart-ch kill-ch opts monitoring task-component-fn))]
            (assoc component
                   :outbox-loop-ch outbox-loop-ch
                   :processing-loop-ch processing-loop-ch

           :kill-ch nil :restart-ch nil
           :outbox-loop-ch nil :processing-loop-ch nil)))

(defn virtual-peer [opts peer-group task-component-fn]
  (map->VirtualPeer {:opts opts :peer-group peer-group :task-component-fn task-component-fn}))
