Interface with Contexts?
steve-gray opened this issue · 9 comments
Small feature request - Would it be possible to extend all of the interface operations to have context parameters on a "WithContext" version of the interface, so that repositories/stores can implement contracts that have a context, such as database backed stores? We're finding a little bit tricky at times and having to basically use context.TODO() as we can get a context from the incoming GRPC calls down to the store inside.
We've toyed with other architectures/solutions, including creating an instance per call and using a globally smuggled context variable, but its' just hard yards.
Yes, sounds good! Would you be up for a PR? :)
Is this still a requested feature? We have a forked version that includes the context parameters. We can open a PR if this is still something you all would like to see implemented.
I don't know for project owners. But I'm interested. So I would love seeing a PR.
Yes, contributions welcome! Larger code changes will probably take some time for review, but if it's just adding contexts to some function signatures no biggie :) Glad to see this library still being used :)
Hey all, I've since closed the previous PR and opened a new one. It's been a while since I've taken a look at this but should now be up to date with master and have a passing build: #163
Merged
released in 1.3.0, thanks