2
我試圖圍繞代理商撥打代理時發生的情況。代理商電話代理商
(def top (agent 0))
(def bottom (agent 1))
我有一個最小的一對:
(defn testA []
"This returns 'top', whose value is 'bottom', whose value is 2."
(send top (fn [top-value]
(send bottom inc)))
(await top)
top)
(defn testB []
"This never terminates."
(send top (fn [top-value]
(send bottom inc)
(await bottom) ;;<- this is new
bottom))
(await top)
top)
什麼是與內部的await發生?當一個代理人打電話給另一個代理時,什麼因素起作用?
感謝,