* Updated coroutines to RC02 and fix Flow invariance
This PR fixes an invariance problem in side collect where it was
creating a scope and emitting from there.
* Fix KeyTracker not to lose emissions
KeyTracker would lose some emissions if they happen in rapid succession
between different keys. This new implementation maintains a separate
channel for each key to avoid that. Since we now create a channel per key,
we also need to track and clean them up to avoid consuming too much memory
This PR fixes an issue in NoOpPersister where it was using a CoroutineScope w/o
really needing one as there wasn't any actual deferred work going on. As a side
effect of that, it was flaking the StoreTest.
After this change, the test does not flake aynmore (tried by setting test to be re-run
until failure
* try delegaitng get calls to steam
* WIP handle null
This CL changes pipeline persister to handle null reader response to fetch.
This is WIP, need another fix before it can be used
* move StoreTest and StoreWithParserTest to coroutines testing lib
The test coroutine scope checks for any remaining jobs at the end of a test
which helped us find two bugs (#17, #18) both of which were discovered when
i tried to move this tests to the TestCoroutineScope after the streamOnly
change.
This change completes the move to avoid further regressions. Eventually,
we should move all tests
* remove unused get method from PipelineStore
* Fix KeyTracker subscription order
This PR fixes a race condition where if the SimplePersisterAsFlowable's write
is called inside a reader, reader wouldn't be notified again
* Fix StreamOneKeyTest
This test was passing by mistake :/. Right now, when we create the backport
Store from a Pipeline, the method skips memory cache but uses
disk cache. This test was not initializing the disk cache w/ empty value,
which meant the initial read would get first value as if it is cached and
then would also get the new value.'
The test didn't fail before because KeyTracker had a concurrency but where
it missed 1 invalidation call
This PR fixes a bug in side-collect where it was not cancelling the side
collection when main flow stops.
It still does not handle the case where side collect fails but that can only be fixed when we have error handling.
Needed to move the method to a non-private place to be able to write tests :/
StoreRequest to encapsulate the get/stream into an object that can be passed down/modified/scaled.
The suspend cache APIs became a bit weird due to supporting both implementations. We can clean it up once we have only 1 implementation.
This PR adds a cache implementation that has all APIs as suspend functions.
It uses guava's cache under the hood and handles query deduplication in a custom
Entry type that we keep in the cache
* AGP 3.5.0-beta05
* Inflight as constructor argument
* New builder class
* Rename addPersister to persister
* Rename addParser to parser
* Rename addCache to cache
* AGP 3.5.0-beta04
* Stream implementation defined in the interface
* New class StoreWrapper
* Delete StoreBuilder
* Rename plus methods
* Move stalePolicy to Persister
* Simplify code
* Move inflight request management to a new class
* Move cache management to a new class
* Move wrappers to new package
* Delete StoreWrapper class
* New test
* Restored old versions
* Restored old versions
* Restored old versions
* Restored old versions
* Restored old versions
* Restored old versions
* Add runCatching to ignore exceptions on persisters
* Backward compatible RealStoreBuilder implementation
* Fix tests