-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not store context inside structs #190
Comments
Looking closer at this issue, I realized the current implementation should probably be left as is. First of all, the rule of thumb in Go is to pass context as a parameter to methods instead of storing it in structs. However, in NWC, the context is stored within |
I think there are still some places where we can reduce the usage of the context stored in the service - by moving the Would that sound like a good idea to you? |
Right, that makes sense. I moved it to main_http. However, I am not so sure about Wails — do we need to handle signals there? Doesn't Wails handle shutdown on its own?
That could work, actually. First I thought it was impossible, since I will implement that! |
I have implemented the proposed changes. I tried to remove the context from the service entirely, but that turned out to be much trickier. The service's context is used as the parent context when starting the API in the |
See getAlby/nostr-wallet-connect-next#92 (comment)
The text was updated successfully, but these errors were encountered: