eclipse-thingweb / eclipse-thingweb/node-wot
`servient.shutdown` does not close open http connections
- Dominant language
- TypeScript
- Stars
- 192
- Forks
- 100
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 6
Description
As stated in https://github.com/eclipse-thingweb/node-wot/issues/1503#issuecomment-4091231642:
> The hard thing is that await servient.shutdown(); should also work (instead of using the subscription object and stopping it). However, it does not close the subscription as it only calls HTTPFactory destroy -> which does nothing. Probably this is a separate issue, and this one can be closed once the example is updated as above.
A trivial solution could be to keep a reference to the HTTP client created in the HTTPFactory and close it when it is destroyed. But I noticed that we are currently caching clients also at the `ConsumeThing` level, which is a little bit counterintuitive as it should be the binding to decide what and when to cache. Probably a proper review of the current core -> protocol bindings interaction pattern is needed before closing this issue.
Contributor guide
Assessment
This issue has not been assessed yet.