pool

package
v1.2.117 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Walk

type Walk = sync_.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

type WalkFunc

type WalkFunc = sync_.WalkFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL