本文整理匯總了Golang中github.com/tsuna/gohbase/hrpc.RegionInfo.AvailabilityChan方法的典型用法代碼示例。如果您正苦於以下問題:Golang RegionInfo.AvailabilityChan方法的具體用法?Golang RegionInfo.AvailabilityChan怎麽用?Golang RegionInfo.AvailabilityChan使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/tsuna/gohbase/hrpc.RegionInfo
的用法示例。
在下文中一共展示了RegionInfo.AvailabilityChan方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: waitOnRegion
func (c *client) waitOnRegion(rpc hrpc.Call, reg hrpc.RegionInfo) (proto.Message, error) {
ch := reg.AvailabilityChan()
if ch == nil {
// WTF, this region is available? Maybe it was marked as such
// since waitOnRegion was called.
return c.sendRPC(rpc)
}
// The region is unavailable. Wait for it to become available,
// or for the deadline to be exceeded.
select {
case <-ch:
return c.sendRPC(rpc)
case <-rpc.Context().Done():
return nil, ErrDeadline
}
}