Replies: 1 comment
-
Hey @ZHOUYue67! Sorry for the delay, I've been busy the last weeks. Yes, your usage in I'm thinking the group object could expose the underlying context via a pool := pond.NewPool(10)
defer pool.StopAndWait()
group := pool.NewGroupContext(parentCtx) // use parentCtx or ctx here is about the same
group.SubmitErr(func() error{
err := doSomethingComplex(group.Context())
return err
})
group.SubmitErr(func() error{
err := doSomethingElseComplex(group.Context())
return err
})
if err := group.Wait(); err != nil {
// No need to explicitly cancel the context
// continue to handle error
} I don't want to return this context when creating the group (as it was in What do you think about this change? Thanks for brining this up 🙂 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not too familiar with pond.
In
v1
, I can do something like:In order to do the equivalent in
v2
, I came up with something like:Questions:
v2
correct?NewGroupContext()
not returning the derived Context likev1
by design? I really want to know pros and cons.Thank you for your time!
Beta Was this translation helpful? Give feedback.
All reactions