-
Notifications
You must be signed in to change notification settings - Fork 186
Documentation unclear on proper extended usage of WriteApi client #190
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
Comments
Hi @markmnl, thanks for your comment.
Currently not, but It is a good suggestion 👍 and we will add support for this.
I think the context manager will close the
Currently We don’t have an explicit Anyway thanks for your comment! Regards |
Hi. A context manager would be really nice indeed. It is also unclear to me the difference between Are the three following lines needed? write_api.close()
write_api.__del__()
client.__del__() I didn't dive into the internals but it sounds very strange to call I wouldn't find it strange if I had to call a flush method manually, though. Also, if In any case, a proper context manager should take care of all this. |
Answering myself (partly). For both influxdb-client-python/influxdb_client/client/write_api.py Lines 263 to 265 in a3e18ee
influxdb-client-python/influxdb_client/client/influxdb_client.py Lines 165 to 167 in 5eb4cdf
I guess we should use Definitely something nice hiding in a context manager. |
Uh oh!
There was an error while loading. Please reload this page.
Does the WriteAPI client support context management? If so what does the context manager do - flush, close, wait for batch to complete? I cannot answer any of these queststions reading the doucmentation so I don't know if I should be creating a new instance of WriteApi client evey time I want to write a new batch..
This part of the documentation I find contradictory - singleton implies never create another instance - but it goes on to say I should close to flush?? What if I have a service continuously running? How can I flush what has already been written if I want to? I don't feel confident reading the documentation using this library...
The text was updated successfully, but these errors were encountered: