DynamicIterators.jl
DynamicIterators.jl copied to clipboard
Ressource management
One could wonder if DynamicIterators should support the notion of closing iterators to facilitate ressource management.
It appears that this can be done with minimal overhead. Basically, iterators already implement message passing with the message nothing for starting and stopping.
The solution can be to define a "PostProcess(state, message)" state which sends Close() up-range.
I added an example explaining how this can be done:
https://github.com/mschauer/DynamicIterators.jl/blob/master/example/ressourcemanagement.jl