-
Notifications
You must be signed in to change notification settings - Fork 99
servient.shutdown does not close open http connections #1506
Description
As stated in #1503 (comment):
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.