batching

command module
v0.0.0-...-b0500b1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

README

batching

Nurseries have a natural way to limit concurrency: batch Tasks into slices of the maximum permitted concurrency. In this example, 5 URLs are fetched in batches of 2, ensuring that no more than 2 requests are in flight at a time.

Because nursery.Open() doesn't return until all Tasks started are done, it can be used in a simple for loop. There is no need to maintain a pool of workers or enforce concurrency limits externally.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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