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

AsyncSequence caching #2

Open
mvolkmann opened this issue Jan 2, 2023 · 0 comments
Open

AsyncSequence caching #2

mvolkmann opened this issue Jan 2, 2023 · 0 comments

Comments

@mvolkmann
Copy link

If there's a better place for me to ask questions about the book than here, please let me know. I'm happy to post them elsewhere.

On page 175 you say "If you use the same async sequence in another loop, you will get the data instantly, because it will be cached."

I wonder what happens if the sequence is very long and/or the values it returns are very large. It seems like the app could crash due to running out of memory. I wonder if it only caches the values if there is enough free memory to do so.

I also wonder if it is possible to create an infinite AsyncSequence that never stops returning values ... in which case it definitely couldn't cache all the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant