* Fix typos.
* Gradle 6.1, AGP 4.0.0-alpha09, lifecycle 2.2.0.
* Add experimental invalidateAll() support and @ExperimentalStoreAPI annotation.
* Update sample with deleteAll function.
* Update README.md with deleteAll function.
* Add a section to README.md on clearing store entries.
* Rewrite tests without mocking. Move test utils / helpers to a single package.
* Code formatting and cleanups.
* Use StoreResponse.Data instead of DataWithOrigin in ClearAllStoreTest and ClearStoreByKeyTest.
* Simplified samples. Refactor tests.
* Gradle 6.1.1.
* Rewrite cache module in Kotlin.
* Migrate RealStore to use new cache.
* Migrate FileSystemImpl to use new cache.
* Migrate StoreTest to new cache.
* Remove Guava Cache.
* Migrate remaining Java file to Kotlin.
* Fix ktlint error.
* Fix package.
* Add support for CacheLoader.
* Remove unnecessary mockito-inline.
* Remove volatile keyword from CacheEntry fields and add docs re. cache entry reuse and thread-safty assumption.
* - Refactor CacheBuilder.
- Update docs.
- Update Key, Value, Input, Output generic types to be bound by Any.
- Replace spy with TestLoader for asserting invocation.
* Support key-based synchronization for get(key: Key, loader: () -> Value): Value.
* Document loader exception propagation.
* Small clean ups.
* Make CacheEntry's Key and Value bound to Any, move CacheEntry to RealCache.kt as a private class.
* Add reference counting key-based synchronization for cache loader.
* Improve KeyedSynchronizer and docs.
* Refactor tests and add a missing test case to reach 100% coverage.
* Add memory barrier after updating access time in cache entry.
* Only process access queue if expiresAfterAccess == true.
* Support configurable concurrency level.
* Increase delay for concurrency test.
* Explicitly set concurrency level for concurrency tests.
* Only add memory barrier after recordRead if expiresAfterAccess is enabled.
* Fix a potential memory leak caused by thread preemption.
* Allow retries (3 times) for concurrency tests.
* Move performMaintenance function to bottom of the class.
* Fix typos, rename performMaintenance() to cleanUpDeadEntries(), improve docs.
* Fix more typos.
* Only remove entries in map but not in queue.
* Replace memory barrier with @Volatile fields in CacheEntry.
* Fix deadlock while iterating sets.
* Remove stale cache/README.md, remove commented out java file.
* Add kotlin plugin to cache module
* Remove custom accessors in StoreDefaults as default values are effectively constant.
* Update JUnit to 4.13 RC2 to enable asserting specific error message on expected exception.
* Remove custom accessors in MemoryPolicy as all values are calculated from constants.
* Remove checkstyle and pmd as the codebase will be 100% Kotlin.
* Fix IDE warning in build.gradle by removing static imports.
* Remove unused guava dependencies.
* Improve StoreDefaults docs.
* Update dependencies and clean up unused ones.
* Update okio to 2.4.1 and migrate deprecated APIs to extension functions.
* Update platform and build-tools in travis config.
* WIP publish test
* add actor based implementation, seems the most promising
* add notes into channel manager as well
* use unlimited channel on the receiver to avoid launching to send
* carry over remaining subscribers into a new flow
* dispatch errors from upstream to all downstreams
* carry over all leftovers at once to avoid starting producer before all is added to the list
* handle swapping channel managers in the consumer
This CL fixes an issue where we wouldn't unsubscribe from the right channel if
the downstream is moved between channel managers due to not receiving any event
after registering.
I've also cleaned up dispatchError to close the channel with error instead of
passing it down as if it is value and throwing again
* allow live buffering
this adds a live buffering functionality to actor publish where
it only buffers if the upstream is still running
* remove logging
* move into src
* code cleanup, more comments
* first shot at new internal store, tests pass, code ugly
* tmp builder for real internal store, starting pipeline tests
* more wip in fixing pipeline store tests, a lot to cleanup
* all tests pass
* code cleanup
* move multiplexer inside store4
* lots of cleanup of unnecessary code
* release barriers that are not used
* don't use pipeline persister.
also fixed a barrier cleanup code in source of truth with barrier
* revert simple persister as flowable change
cleanup for clearstorememorytest
* close multiplexers in fetcher controller when not used
* code style fixes
* Introduce StoreResponse
This CL changes Pipeline API to dispatch StoreResponse instead of Output.
It will allow us to add more metadata into it and also handle things like
source attribution and/or loading state.
This CL only makes the tests pass, does not do anything for actually dispatching
loading state
* first shot at adding a loading state
This CL adds proper StoreResponse to the built in pipelines such
that they can merge information between network and disk.
It needs some cleanup and PipelinePersister's merging logic is
fairly complicated but i couldn't yet find a simpler way to achieve it
* Add more tests to pipeline
Also fixed a bug in cached where it would emit cached value as
Loading even if no refresh is requested
* fix room sample after rebase
* Update the room sample to support refresh
Also some code cleanup in PipelinePersister
* code cleanup
* explain network + disk flow
* Change StoreResponse for plan D
This CL changes store response to act like plan D described here:
https://paper.dropbox.com/doc/Streaming-Data-How-To--AkwrNu0A7\~BikNOP2m20\~R2_AQ-oLBV39GrNimqGDe1vNQMb
Now StoreResponse has 3 types: Data, Error, Loading and each of these have an field.
Loading and Error does not carry over last data anymore, instead, it is expected downstream
to merge them for UI, if desired.
This change makes Store more verbose but i think it is the right direction to allow
developer to expand on it as desired
* update AGP to 3.6-alpha11
* update pipeline store tests to check finite streams
This CL updates PipelineStoreTest to consume the whole stream
when we expect it to finish rather than limiting the number of
dispatched items
* update RoomActivity to respect new StoreResponse
* add search to room activity
* code cleanup
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
* start of sample app conversion to kotlin
* go with moshi kotlin codegen instead of immutables
* pr feedback, use lateinit and make non-null
* pr feedback, unwind method
* roomStore
* kt the app class
* refactor
* fix compilation
* Update .travis.yml
* migrate relevant tests to RoomStore, mark new Room API with @Experimental
* pr feedback
* bump minor rev up
* cleanup store
* create factory, clean up example
* pr comments
* Gradle Wrapper (all) 3.3 -> 4.1
* Gradle plugin for Android 2.3.2 -> 3.0.0-beta2
This requires upgrading the errorprone plugin to 0.0.11. Also, see
https://stackoverflow.com/questions/44196672/aapt2-compile-failed-invalid-dimen-on-android-3-0-canary-1
gradle plugin
* SDK Build Tools 25.0.2 -> 26.0.1
* Remove retrolambda
* Log error from subscription on PersistingStoreActivity for consistency
* Update dependency inclusion directives to those of the 3.0 plugin
Also, jsr305 and javax usages have been taken from compile to compileOnly
since they are not required beyond.
* Add dependencies that previously were resolved through leaked ones from other artifacts
Now dependency leaks are eliminated thanks to 'implementation' from the 3.0 version of the gradle plugin.
* Remove coupling between middlewares and cache
* Replace mockito-all by mockito-core
mockito-all causes problems related to hamcrest when used with JUnit. See
https://tedvinke.wordpress.com/2013/12/17/mixing-junit-hamcrest-and-mockito-explaining-nosuchmethoderror/
* Remove unused dependency.
* Build Tools 26.0.1 on Travis
* Suppress PMD.AvoidThrowingNullPointerException for the time being
* Avoid PMD synthetic accessor warning
* Add store-kotlin module
* Remove useless file
* Fix package in AndroidManifest
* Refactor module tests to assertJ
* Remove wrong annotation
* Add store-kotlin artifact to README
* Add module README
* Add KDoc to Javadoc jar
* Add Experimental annotation
* Mark all public store-kotlin classes as @Experimental
* Replace use of rx's @Experimental with local one instead
* Fixed a race condition that would appear when the read was called but not immediately subscribed to. Defer the whole file check till subscription.
* Diamonds
* General cleanup, missing nullity annotations, missing override annotations
* More key naming conventions
* Dependency update
* More key naming conventions
* Parser, not func
* Name outer key different so cache can be evicted correctly
* Another missing override