Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const (
QSize = 64
)
Variables ¶
This section is empty.
Functions ¶
func Collect ¶ added in v0.0.3
Example ¶
doWork := func(url string) chan error { errs := make(chan error) go func(url string) { // Some expensive work.. _, err := http.Get(url) if err != nil { errs <- err } }(url) return errs } for err := range Collect( doWork("1"), doWork("2"), ) { if err != nil { fmt.Println("Error:", err) } }
Output:
Types ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
func NewSemaphore ¶
type UnboundedChan ¶ added in v0.0.6
type UnboundedChan struct { // Q *gxqueue.Queue Q *deque.Deque // contains filtered or unexported fields }
refer from redisgo/redis/pool.go
func NewUnboundedChan ¶ added in v0.0.6
func NewUnboundedChan() *UnboundedChan
func (*UnboundedChan) Close ¶ added in v0.0.6
func (q *UnboundedChan) Close()
func (*UnboundedChan) Len ¶ added in v0.0.6
func (q *UnboundedChan) Len() int
func (*UnboundedChan) Pop ¶ added in v0.0.6
func (q *UnboundedChan) Pop() interface{}
func (*UnboundedChan) Push ¶ added in v0.0.6
func (q *UnboundedChan) Push(v interface{})
func (*UnboundedChan) SetWaitOption ¶ added in v0.0.6
func (q *UnboundedChan) SetWaitOption(wait bool)
在pop时,如果没有资源,是否等待 即使用乐观锁还是悲观锁
func (*UnboundedChan) TryPop ¶ added in v0.0.6
func (q *UnboundedChan) TryPop() (interface{}, bool)
Click to show internal directories.
Click to hide internal directories.