# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 1
# self = https://watcher.sour.is/conv/rxciata
深入理解 go sync-Con
在 go 的標準庫中,提供了 sync.Cond 這個併發原語,讓我們可以實現多個 goroutine 等待某一條件滿足之後再繼續執行。 它需要配合 sync.Mutex 一起使用,因爲 Cond 的 Wait 方法需要在 Mutex 的保護下才能正常工作。 對於條件變量,可能大多數人只是知道它的存在,但是用到它的估計寥寥無幾,因爲很多併發場景的處理都能使用 chan 來實現, 而且 chan 的 ⌘ Read more