Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Deprecate AsyncCache.fetchStream. #209

Merged
merged 4 commits into from
Mar 23, 2022
Merged

Deprecate AsyncCache.fetchStream. #209

merged 4 commits into from
Mar 23, 2022

Conversation

lrhn
Copy link
Contributor

@lrhn lrhn commented Mar 16, 2022

The featchStream feature complicates the AsyncCache class, and would be a better fit for a separate class.
The functionality is not great. Since it returns the "same" stream each time the cache is queried (until evaluated), it actually
caches all stream events.
The invalidation is tricky because the timer doesn't start until you listen to the stream. In practice, people will usually listen to the stream they fetch.

It also seems that no-one ever used the functionality.
There is no use inside Google, or in Github, outside of the package's own tests.

The feature complicates the `AsyncCache` class, and would be a better fit
for a separate class.
The functionality is not great. Since it returns the "same" stream
each time the cache is queried (until evaluated), it actually
caches all stream events
The invalidation is tricky because the timer doesn't start until
you *listen* to the stream. In practice, people will usually
listen to the stream they fetch.

It also seems that no-one ever used the functionality.
There is no use inside Google, or in [Github](https://github.com/search?q=%22.fetchStream%22+language%3ADart+-filename%3Aasync_cache.dart+-filename%3Aasync_cache_test.dart&type=code),
outside of the package's own tests.

It's a better fit for a separate class, but it also appears to
not be used anywhere
@lrhn lrhn requested a review from natebosch March 16, 2022 16:25
@lrhn lrhn merged commit b18c73e into master Mar 23, 2022
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 14, 2024
* Deprecate `AsyncCache.fetchStream`.

The feature complicates the `AsyncCache` class, and would be a better fit
for a separate class.
The functionality is not great. Since it returns the "same" stream
each time the cache is queried (until evaluated), it actually
caches all stream events
The invalidation is tricky because the timer doesn't start until
you *listen* to the stream. In practice, people will usually
listen to the stream they fetch.

It also seems that no-one ever used the functionality.
There is no use inside Google, or in [Github](https://github.com/search?q=%22.fetchStream%22+language%3ADart+-filename%3Aasync_cache.dart+-filename%3Aasync_cache_test.dart&type=code),
outside of the package's own tests.

It's a better fit for a separate class, but it also appears to not be used anywhere
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants