 (defn offer-ch-loop [log sync]
   (loop []
     (let [event (<!! offer-ch)]
-      (when (offer-task log sync)
+      (when (offer-task log sync
+                        #(>!! ack-ch %)
+                        #(>!! completion-ch %))
         (thread (<!! (timeout eviction-delay))
                 (>!! evict-ch nil)))
       (recur))))

(defn born-peer-ch-loop [log sync]
  (loop []
    (let [peer (<!! born-peer-ch)]
      (mark-peer-birth log sync peer)
      (>!! offer-ch peer)
      (recur))))


  (extensions/delete sync task)
  (extensions/evict log task))

(defn offer-task [log sync ack-cb complete-cb]
  (when (extensions/next-task log)
    (extensions/create-ack-node sync)
    (extensions/create-completion-node sync)
    (extensions/await-ack sync ack-cb)
    (extensions/await-completion sync complete-cb)
    (extensions/mark-offered log)
    (extensions/write-payload sync)))

