Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Walk ¶
Example ¶
package main import ( "context" "fmt" "github.com/searKing/golang/go/x/pool" ) func main() { // chan WalkInfo walkChan := make(chan any, 0) p := pool.Walk{ Burst: 1, } defer p.Wait() p.Walk(context.Background(), walkChan, func(name any) error { fmt.Printf("%s\n", name) return nil }) for i := 0; i < 5; i++ { walkChan <- fmt.Sprintf("%d", i) } close(walkChan) }
Output: 0 1 2 3 4
Click to show internal directories.
Click to hide internal directories.