-
Notifications
You must be signed in to change notification settings - Fork 23
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
How do I close Bunq API connection? #112
Comments
If you can just give me a pointer, then I can create a pull request as well. No problem. |
I have this problem as well. It is highly annoying. From my point of view a client should never keep a thread running unless explicitly asked for by the developer. I need to have control over my threads. Also: this doesn't sparkle with the principle of least surprise. |
Might this have to do with the HTTP/2 nature of the used http client? Since HTTP/2 allowes multiplexing connections, the client needs to keep the connection open to receive new responses. It is, however, annoying that there is no explicit close method on this. Timeout is set on 30 seconds, the client, however does not error out after 30 seconds, so I'm not entirely sure here. |
Update, client exits after 1 minute. |
To force the application to exit, you can end your main method with |
@ChappIO The OkHttp client being used in the core of the client seems to be closeable. See also https://stackoverflow.com/questions/29055724/okhttpclient-close-connection In effect the Bunq API client needs to call close on (all) the response bodie(s) it has a connection for. ( |
Steps to reproduce:
ApiContext
BunqContext.loadApiContext(context)
What should happen:
What happens:
Traceback
SDK version and environment
I would expect this application to close after a bit. However, when I run it there are still a few threads there. I see no
close
methods on the context so how do I close the context?The text was updated successfully, but these errors were encountered: