sliemeobn / ipp-nio

Internet Printing Protocol (IPP) implementation for Swift based on swift-nio.
https://swiftpackageindex.com/sliemeobn/ipp-nio/main/documentation
Apache License 2.0
9 stars 1 forks source link

HTTPClient needs to be shutdown after use to avoid memory leak #4

Open ronnybremer opened 1 month ago

ronnybremer commented 1 month ago

See https://github.com/swift-server/async-http-client/blob/main/README.md#request-response-api

ronnybremer commented 1 month ago

Fixes #3

ronnybremer commented 1 month ago

However, I am afraid if we want to clean this up for good, we'd need to change the "exiting" behavior as well (see comment below)

Quite right. It's always a struggle with examples, as they are for demonstration and not really high quality code.

ronnybremer commented 1 day ago

I don't want to be too pedantic on a silly little example like this, but I think it reads less cleanly than before.

Would you mind refactoring the while-loop to work without exit and have a single shutdown.

What do you think, is this better?