Skip to content

Releases: codeclysm/cc

Fix a out of stack issue

16 Jan 11:02

Choose a tag to compare

v1.2.2

Goroutines are started only when they can be ran

Support multiple funcs in Stoppable

22 Aug 10:10

Choose a tag to compare

v1.2.1

Support multiple parallel functions to StoppableFunc

Add Stoppable functions

22 Aug 08:08

Choose a tag to compare

stoppable := cc.Run(func(stop chan struct{}) {
	i := 0
L:
	for {
		select {
		case <-stop:
			fmt.Println("receive stop signal")
			break L
		default:
			i++
			time.Sleep(250 * time.Millisecond)
			fmt.Println(i)
		}
	}
	fmt.Println("finished with", i)
})

go func() {
	time.Sleep(1 * time.Second)
	fmt.Println("send stop signal")
	stoppable.Stop()
	stoppable.Stop() // It shouldn't explode even if you attempt to close it multiple times
}()

<-stoppable.Stopped
fmt.Println("stopped finally")
// Output: 1
// 2
// 3
// send stop signal
// 4
// receive stop signal
// finished with 4
// stopped finally

Use a concurrent multierror

10 Aug 14:26

Choose a tag to compare

v1.1.0

Use a concurrentmultierror

v1.0.0

22 Jun 12:32

Choose a tag to compare

Add readme