Httpclient lifecycle stop and start methods

Hi guys,
I’m developing a binding that retrieves data via http from two different sources - cloud API and local IP address… as said in the dev guidelines I should retrieve the http client centrally.
I wanted to ask you do I have to call the start() before use and should I call always stop() after finishing use?
From what I see in AbstractLifeCycle class in Jetty it is used to do call some “after” methods in the registered listeners but not sure if there are any other means for this.

What is the best practice here and how do you use it if you’re not using listeners in your code? I guess it’s not necessary in such a case…

Cheers,
K.

You can use the core to either a) get a reference to the OH common client, or b) create a client specifically for yourself. In case of a) do NOT start or stop it, but in case b) do indeed start and stop it.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.