We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func Wait will panic, because callback is nil.
Can func Wait support nil callback? Maybe do nothing when callback is nil is better
st := stream.New().WithMaxGoroutines(20) st.Go(func() stream.Callback { return nil } st.Wait()
The text was updated successfully, but these errors were encountered:
There is an example. Recover() in st.Go works, but st.Wait() still panic.
package main import ( "fmt" "github.com/sourcegraph/conc/stream" "time" ) func main() { for i := 0; i < 5; i++ { st := stream.New().WithMaxGoroutines(20) for i := 0; i < 10; i++ { idx := i st.Go(func() (callback stream.Callback) { //callback = func() {} // if comment will panic defer func() { if err := recover(); err != nil { fmt.Println("haha", err) } }() if idx == 2 || idx == 4 { panic(idx) // this panic will be recovered } return func() { } }) } st.Wait() // panic occurs here } time.Sleep(1 * time.Second) }
Sorry, something went wrong.
No branches or pull requests
func Wait will panic, because callback is nil.
Can func Wait support nil callback? Maybe do nothing when callback is nil is better
The text was updated successfully, but these errors were encountered: