      (onyx.api/shutdown-peer v-peer))
 
    (onyx.api/shutdown-peer-group peer-group)
-   
+
    (onyx.api/shutdown-env env)))

  (def out-2-calls
    {:lifecycle/before-task :onyx.peer.killed-job-test/inject-out-2-ch})

  (def lifecycles
    [{:lifecycle/task :in-1
      :lifecycle/calls :onyx.peer.killed-job-test/in-1-calls}
     {:lifecycle/task :in-1
      :lifecycle/calls :onyx.plugin.core-async/reader-calls}
     {:lifecycle/task :in-2
      :lifecycle/calls :onyx.peer.killed-job-test/in-2-calls}
     {:lifecycle/task :in-2
      :lifecycle/calls :onyx.plugin.core-async/reader-calls}
     {:lifecycle/task :out-1
      :lifecycle/calls :onyx.peer.killed-job-test/out-1-calls}
     {:lifecycle/task :out-1
      :lifecycle/calls :onyx.plugin.core-async/writer-calls}
     {:lifecycle/task :out-2
      :lifecycle/calls :onyx.peer.killed-job-test/out-2-calls}
     {:lifecycle/task :out-2
      :lifecycle/calls :onyx.plugin.core-async/writer-calls}])

  (def v-peers (onyx.api/start-peers 3 peer-group))

  (def j1 (:job-id (onyx.api/submit-job
                    peer-config
                    {:catalog catalog-1 :workflow workflow-1
                     :lifecycles lifecycles
                     :task-scheduler :onyx.task-scheduler/balanced})))

  (def j2 (:job-id (onyx.api/submit-job
                    peer-config
                    {:catalog catalog-2 :workflow workflow-2
                     :lifecycles lifecycles
                     :task-scheduler :onyx.task-scheduler/balanced})))

  (onyx.api/kill-job peer-config j1)

  (def workflow-2 [[:in-2 :inc] [:inc :out-2]])

  (defn inject-in-1-ch [event lifecycle]
    {:core.async/chan in-chan-1})

  (defn inject-in-2-ch [event lifecycle]
    {:core.async/chan in-chan-2})

  (defn inject-out-1-ch [event lifecycle]
    {:core.async/chan out-chan-1})

  (defn inject-out-2-ch [event lifecycle]
    {:core.async/chan out-chan-2})

  (def in-1-calls
    {:lifecycle/before-task :onyx.peer.killed-job-test/inject-in-1-ch})
