Fix id->message-id
This commit is contained in:
parent
24d0b68c1f
commit
2f6742cdc7
|
@ -24,16 +24,16 @@
|
||||||
mature-ch (async/chan)
|
mature-ch (async/chan)
|
||||||
seen (atom #{})]
|
seen (atom #{})]
|
||||||
(async/go-loop []
|
(async/go-loop []
|
||||||
(let [{:keys [id clock-value] :as msg} (async/<! in-ch)]
|
(let [{:keys [message-id clock-value] :as msg} (async/<! in-ch)]
|
||||||
(swap! seen conj [clock-value id])
|
(swap! seen conj [clock-value message-id])
|
||||||
(async/<! (async/timeout delay-ms))
|
(async/<! (async/timeout delay-ms))
|
||||||
(async/put! mature-ch msg))
|
(async/put! mature-ch msg))
|
||||||
(recur))
|
(recur))
|
||||||
(async/go-loop []
|
(async/go-loop []
|
||||||
(let [{:keys [id clock-value] :as msg} (async/<! mature-ch)]
|
(let [{:keys [message-id clock-value] :as msg} (async/<! mature-ch)]
|
||||||
(if reorder?
|
(if reorder?
|
||||||
(if (earliest-clock-value-seen? @seen id clock-value)
|
(if (earliest-clock-value-seen? @seen message-id clock-value)
|
||||||
(do (swap! seen disj [clock-value id])
|
(do (swap! seen disj [clock-value message-id])
|
||||||
(add-fn msg))
|
(add-fn msg))
|
||||||
(async/put! mature-ch msg))
|
(async/put! mature-ch msg))
|
||||||
(add-fn msg)))
|
(add-fn msg)))
|
||||||
|
|
Loading…
Reference in New Issue