# 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/ieajpxq
Go 的三種擴展原語之 — Semaphore
概述信號量是併發編程中常見的一種同步機制,在需要控制訪問資源的進程數量時就會用到信號量,它會保證持有的計數器在 0 到初始化的權重之間波動。每次獲取的資源都會將信號量中的計數器減去對應的數值,在釋放時重新加回來 當遇到計數器大於信號量大小時,會進入休眠等待其他線程釋放信號 Go 語言的擴展包中提供了帶權重的信號量 semaphore.Weighted,我們可以按照不同的權重管理資源的訪 ⌘ Read more