             injection-results (l-ext/inject-lifecycle-resources* pipeline-data)
             pipeline-data (merge pipeline-data
                                  injection-results
-                                 ((:onyx.core/compiled-pre-fn pipeline-data)
+                                 ((:onyx.core/compiled-before-task-fn pipeline-data)
                                   injection-results))]
 
         (while (and (first (alts!! [kill-ch task-kill-ch] :default true))

(defn inject-batch-resources [event]
  (let [cycle-params {:onyx.core/lifecycle-id (java.util.UUID/randomUUID)}
        results (l-ext/inject-batch-resources* event)]
    (merge event cycle-params results ((:onyx.core/compiled-pre-batch-fn event) results))))

(defn read-batch [event]
  (let [rets (p-ext/read-batch event)]


(defn close-batch-resources [event]
  (let [results (l-ext/close-batch-resources* event)]
    (merge event results ((:onyx.core/compiled-after-batch-fn event) results))))

(defn launch-aux-threads!
  [messenger event outbox-ch seal-ch completion-ch task-kill-ch]
