Actions
Feature #21957
openIntroduce `Enumerable#close` to free internal resources.
Feature #21957:
Introduce `Enumerable#close` to free internal resources.
Description
In some cases, Enumerable has substantial internal state (e.g. Fiber) related to enumeration. There is currently no way to clear up this state besides garbage collection, which means that we can accumulate considerable garbage before cleaning up, even if we know when the enumerable is no longer needed.
I'd like to introduce Enumerable#close which invalidates the enumerable, freeing internal resources. After which, most usage would result in Enumerable::ClosedError.
Actions