Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ressource management #3

Open
mschauer opened this issue Nov 12, 2018 · 3 comments
Open

Ressource management #3

mschauer opened this issue Nov 12, 2018 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@mschauer
Copy link
Owner

One could wonder if DynamicIterators should support the notion of closing iterators to facilitate ressource management.

@mschauer
Copy link
Owner Author

mschauer commented Nov 13, 2018

It appears that this can be done with minimal overhead. Basically, iterators already implement message passing with the message nothing for starting and stopping.

@mschauer
Copy link
Owner Author

The solution can be to define a "PostProcess(state, message)" state which sends Close() up-range.

@mschauer
Copy link
Owner Author

I added an example explaining how this can be done:

https://github.com/mschauer/DynamicIterators.jl/blob/master/example/ressourcemanagement.jl

@mschauer mschauer added the help wanted Extra attention is needed label Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant