add context cancelation
Closed this issue · 3 comments
pjebs 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.
rvql 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.
pjebs 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 }
pjebs commented
?