thumb

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package thumb explores three common concurrency patterns for executing all the iterations of a loop in parallel. Adapted from ch. 8.5 of gopl.io.

Topics: concurrency, loop, design Level: intermediate

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Nail3

func Nail3(filenames []string)

Nail3 makes thumbnails of the specified files in parallel.

func Nail5

func Nail5(filenames []string) (thumbfiles []string, err error)

Nail5 makes thumbnails of the specified files in parallel. It returns the generated file names in an arbitrary order, or an error if any step failed.

func Nail6

func Nail6(filenames <-chan string) int64

Nail6 makes thumbnails of each file received from the channel. It returns the number of bytes occupied by the files it creates. (Here we can't predict the number of iterations because we receive the file names not as a slice but over a channel.)

Types

This section is empty.

Directories

Path Synopsis
Thumb generates thumbnails for the supplied JPEG pictures.
Thumb generates thumbnails for the supplied JPEG pictures.

Jump to

Keyboard shortcuts

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