Hey ! Thanks a lot for your amazing package.
Right now I'm encountering a problem with it.
I have a couple of processing functions which returns their result through channels.
I have also a couple of other functions that use those results and wait them on the channels.
Basically, everywhere, I have:
select {
case res := <-resChan:
if err := otherFunction(res); err != nil {
return err
}
case <-i.t.Dying():
return nil
}
The problem is that in my code, that block is called in parallel multiple times.
So the first call is fine but the second one never get the result the the "resChan" again.
The problem is that in that package, the futures are blocking functions that dies when the action is done or when there is a timeout.
And I can't do a "select" on a function so I can't check for the Tomb dying state.
The real way to solve this would be to add futures directly to the Tomb package that doesn't listen on timeouts but on the dying state of Tomb.
The new block would be:
res, err := future.GetResult()
if err != nil {
return err
}
if err := otherFunction(res.(resType)); err != nil {
return err
}
That would be so powerful and amazing :)
What do you think ?