-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Just wanted to make an issue here for some clarification, when using this library and running
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
//IRC CONFIG CODE HERE
client := irc.NewClient(conn, config)
err = client.RunContext(ctx)
if err != nil {
log.Fatalln(err)
panic(err)
}
The irc client doesn't cancel or close after the 3 seconds given to the context. Sorry if this is a dumb question I'm still fairly new to go contexts!
Thank you so much for the library, really been enjoying it.
Just as a sidenote, when I added the following code to client.go it exits the IRC client after the allotted time as expected.
var err error
select {
case err = <-c.errChan:
case <-ctx.Done():
wg.Done()
}
Metadata
Metadata
Assignees
Labels
No labels