add context cancelation
pjebs opened this issue · comments
pj commented
Some of these algorithms take a long time to calculate for massive amounts of data. It would be nice if you implemented context cancelation.
JIN Jie commented
Could you please elaborate?
I'm not sure how context cancelation should be integrated into this lib, some example or a pull request would be nice.
pj commented
For each function that potentially takes a long time to return, add ctx context.Context
as the first argument.
Then inside the function, check for if err := ctx.Err(); err != nil { return err }
pj commented
?