[External] : Re: Single Thread Continuation

Andrew Haley aph-open at littlepinkcloud.com
Tue Jul 11 16:31:37 UTC 2023


On 7/11/23 16:32, Robert Engels wrote:
> I don’t think it is any different than a database connection and a result set. You CAN close these but typically the system will perform fine if you don’t. The “costly” backend usually has alternative ways of dealing with “lazy” cleanup.

That seems like a nitpick, IMO. Some resources, especially file handles,
are scarce. We used to think we could rely on garbage collection to close
them, but we learned better.

 > To elaborate - since the developer does not have access to the returned
 > iterator in the iterable for each - it is safe to close when it goes out of scope.

Probably. :-)

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the loom-dev mailing list