Open danielpeintner opened 2 years ago
@JKRhb
NAMING: stop() / free() / ? destroy() / shutdown() .. semantic issue Re-using connection?
@JKRhb
@danielpeintner
call 16/05
We can start discussing this in a PR
Sorry for missing the call
- See Generic Sensor API
Do you mean the Generic Sensor API is an argument of having start() and stop(), right?
Most of the protocols are RESTful meaning no need to setup or do some pre-processing. WebSocket for example is an exception where setting up the connection might be useful. For other protocols it might be a void operation.
Question1: Does the TD provide the necessary information. I recall discussions that we were looking for a way to initialize the connection.
Question 2: having a stop() method might also mean we require a re-start() method.. maybe.. or starting over again.
The behavior of start()
and stop()
might differ based on underlying protocols. If those don't require any setup, the only thing is enabling or disabling notifications and serving Things.
I think it's pretty okay design to have start()
and stop()
, because of
If I see it correctly, the result of our discussion here was to add both a start
and a stop
method to the ConsumedThing
class, right?
If I see it correctly, the result of our discussion here was to add both a
start
and astop
method to theConsumedThing
class, right?
I am not sure if we really should do that.
start
is similar to what we do now with the factory method WoT.consume()
. Otherwise it gets clumsy and people most likely do forget to call start()
first etc...stop
somehow makes sense to me to force cleaning-up resources but I am not really sure either ...Personally, I think it is good enough what we have now
I agree that stop()
would be enough. We can add it later, when the use case becomes clear (and requested).
@relu91 raised concerns int a call w.r.t. cleaning up client connections
see https://www.w3.org/2022/03/28-wot-script-minutes.html#t05