Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 679 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 679 Bytes

gock Go GoDoc

Package gock (a portmanteau of the go statement and "block") provides structured concurrency utilities for Go.

ctx, cancel := context.WithCancel(ctx)
things := make(chan Thing)

err := gock.Wait(func() error {
	defer close(things)
	return Produce(ctx, things)
}, func() error {
	defer cancel()
	return Consume(things)
})

// Both Produce and Consume are done here, and err is their combined errors.