Commit graph

38 commits

Author SHA1 Message Date
Matt Ramotar
74bb49ddb5
Migrate to version catalogs (#561)
Signed-off-by: Matt Ramotar <mramotar@dropbox.com>
2023-07-05 18:31:37 -04:00
Matt Ramotar
1d6d9c77af
Target linuxX64 (#537) 2023-03-15 16:26:14 -04:00
Matt Ramotar
022bdb782b
Remove KMMBridge (#530)
Signed-off-by: Matt Ramotar <mramotar@dropbox.com>
2023-03-05 12:11:07 -05:00
Emanuele
2cbce8ac20
Add iOS simulator support for KMM projects (#516)
Signed-off-by: Emanuele Papa <ema987@gmail.com>
2023-02-25 12:29:09 -05:00
Matt
5eff430629 Expose AtomicFU (#505)
Signed-off-by: mramotar <mramotar@dropbox.com>

Signed-off-by: mramotar <mramotar@dropbox.com>
2023-01-16 16:31:12 -05:00
mnakhimovich
fee0bccde7 [Store5] Target Android, iOS, JVM, JS (#493)
* [Temp] Remove all modules

* Remove references to Store 4

* Update CHANGELOG

* Update README

* Add Store 5 foundation
Co-authored-by: Andre Claßen <aclassen@users.noreply.github.com>
Co-authored-by: Mike Nakhimovich <mnakhimovich@Mikes-MBP.localdomain>
2023-01-16 16:31:12 -05:00
matt-ramotar
59a20f91dd
Bump Maven publish plugin (#467)
* Bump Maven publish plugin

Signed-off-by: mramotar <mramotar@dropbox.com>

* Use Dropbox Store

Signed-off-by: mramotar <mramotar@dropbox.com>

Signed-off-by: mramotar <mramotar@dropbox.com>
2022-11-29 09:33:26 -05:00
matt-ramotar
157a2161a9
Flip coordinates (#463)
Signed-off-by: mramotar <mramotar@dropbox.com>

Signed-off-by: mramotar <mramotar@dropbox.com>
2022-11-20 11:16:52 -05:00
lukisk
36a548bc43
Remove downstream channel in noncancellable context. (#440)
Verifying that the channel is properly removed when the downstream flow is cancelled.

Signed-off-by: lukisk <luki.sk@gmail.com>

Signed-off-by: lukisk <luki.sk@gmail.com>
2022-09-07 18:28:24 -04:00
David Chang
bf2adbf127
Move to Maven Publish Gradle Plugin (#358)
* Move to Maven Publish Gradle Plugin

* Remove release scripts

* Update release docs
2021-12-08 12:45:33 -05:00
Chris Mitchell
862da9b4f9
Fix missing experimental annotations (#305)
* Revert "Remove unnecessary FlowPreview & ExperimentalCoroutinesApi annotations.  These are not needed with newer versions of Kotlin. (#289)"

This reverts commit 61b8cb0633.

* Fix missing experimental annotations
2021-09-09 08:46:48 -07:00
Sam Edwards
61b8cb0633
Remove unnecessary FlowPreview & ExperimentalCoroutinesApi annotations. These are not needed with newer versions of Kotlin. (#289) 2021-09-08 18:57:02 -04:00
Mike Nakhimovich
86ab7a5251
Fire off kotlin 1.5 compatible snapshot (#273)
* upgrade to kotlin 1.5 warning breaking change

* upgrading to kotlin15, create new snapshot

Co-authored-by: miken <miken@dropbox.com>
2021-05-10 14:28:52 -04:00
Eyal Guthmann
e773021fec
Revert to use the old guava port cache (via jar) (#200)
* Revert to using guava port cache by depending on jar

* Apply suggestions from code review

* revert code to old cache

* clean up build.gradle

* manually remove cache4 entries that are regenerated locally because of some dirty cache?

* bump gradle

* rerun tasks

* try to deflake rx tests

* cache builder tests

* api dump

* bump ktlint to work with 1.4 features

* formatting

Co-authored-by: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
2020-09-14 14:49:34 -07:00
Eyal Guthmann
1a4b0b0966
use covariance to remove generic types from subtypes like Error (#220) 2020-08-21 14:08:38 -07:00
Yang
a0477c1ed2
Update to Kotlin 1.4.0, Coroutines 1.3.9 and revert to using Duration.INFINITE (#195)
* Update to Kotlin 1.4.0-rc and Coroutines 1.3.8-1.4.0-rc, fix type inference issues.

* Kotlin 1.4.0.

* Coroutines 1.3.9.
2020-08-14 14:17:17 -04:00
Yang
7c3ce55b63
Coroutines 1.3.5 (#166)
* Update Kotlin, Coroutines, Rx2, OkHttp, Okio, Gradle.

* Clean up @FlowPreview @ExperimentalCoroutinesApi which are no longer required.
2020-05-09 10:21:25 -04:00
Dave Parker
8f0625fc70
Contain @ExperimentalStdlibApi within relevant scope. (#154)
* Contain @ExperimentalStdlibApi within relevant scope.

The alpha04 release of Store caused the requirement of the @ExperimentalStdlibApi annotation for client code. I looked into it, and the only thing in Store that required the annotation was the Kotlin ArrayDeque used in the BufferImpl class. That class is private in the ChannelManager.kt file, so I opted that file into the annotation and removed all other occurences of the annotation.

Code compiles, all 208 tests pass.

* update to correct git glitch in /build.gradle

* update to address 'needless blank line' linter

* Prepare for release 4.0.0-alpha05

* Prepare for next development version.

Co-authored-by: Dave Parker <davidp@dropbox.com>
2020-04-19 19:51:50 -04:00
Claus Holst
031d92e5b4
Use AtomicFu to replace Java's AtomicBoolean and ReentrantLock (#147)
* Use AtomicFu instead of AtomicBoolean

* Use AtomicFu for ReentrantLock in KeyedSynchronizer
2020-04-10 08:38:54 -07:00
Claus Holst
f809dc688e
Migrate Multicast to Kotlin Test (#146) 2020-04-07 11:48:04 -04:00
Claus Holst
5d5e89b13b
Use Kotlin version of ArrayDeque in ChannelManager (#134) 2020-03-16 08:08:32 -07:00
Yang
38baeb7c8b
Kotlin 1.3.70 and other dependencies updates. (#125)
* Update Kotlin, Gradle, binary-compatibility-validator, AGP, AndroidX, retrofit, okhttp, rx2.

* Replace deprecated @UseExperimental with @OptIn.

* Gradle 6.2.2.

* Update Coroutines to 1.3.4. Fix more compiler warnings.

* Update build-tools for travis.
2020-03-07 09:38:02 -05:00
Yigit Boyar
daa1c13ff7
Make SharedFlowProducer APIs safe (#121)
* MakeSharedFlowProducer APIs safe

This PR fixes a bug in SharedFlowProducer where it would not handle start being called
multiple times or cancel being called before start is completed. It could even consume
the upstream flow multiple times if start is called multiple times.

Fixes: #120
Test: SharedFlowProducerTest

* get rid of unnecessary start call
2020-02-29 10:01:53 -08:00
Yang
8bc3c76eb1
Start tracking API binary compatibility (#97)
* Configure binary-compatibility-validator plugin.

* Generate current API dumps.

* Update CONTRUBUTON.md with instruction for updating API dumps.
2020-02-15 11:59:42 -05:00
David Chang
536af1f455
Add code coverage (Jacoco) and CodeCov (#100)
* [WIP] Add code coverage

* Get multi-module and merging working

* Add CodeCov

* Update location of report.xml

* Check instead of build depends on Jacoco

* Do not merge coverage

* Ignore tests

* update comment
2020-02-13 17:42:05 -08:00
Eyal Guthmann
86f7b1b060
introduce piggyback only downstreams to multicaster and fix #59 (#75)
* patched-from-yigit

* piggyback only channels

* cleanup docs and tests

* add yigit's test. piggyback now acks upstreams, pr comments

* tests names

* fix test name

* comments

* Update store/src/test/java/com/dropbox/android/external/store4/impl/FlowStoreTest.kt

Co-Authored-By: Yigit Boyar <yboyar@google.com>

* remove import

Co-authored-by: Yigit Boyar <yboyar@gmail.com>
2020-01-25 13:13:12 -08:00
ychescale9
7ee32a7468 Clean up build configs (#62)
* Update dependencies, clean up unused dependencies.

* Remove unused checkstyle and pmd rulesets.

* Use `plugins` block.

* Fix compiler warnings.
2020-01-13 12:43:41 -05:00
Eyal Guthmann
54c7ad5113
Add an optional param to Multicaster to keep the fetches alive even if all downstreams are closed. (#40) 2020-01-02 13:14:18 -08:00
Yigit Boyar
8819cedc2a Properly implement multicast closing (#48)
* Properly implement multicast closing

This PR defines the behavior of Multicast Flow.
Previously, it could crash if new observers are added to the
multicaster or if it is closed while there is an active
collector. Now, both of these operations complete without
an error. Collecting on a closed multicaster receives 0
values and closes immediately.

Fixes: #45
Test: ChannelManagerTest, MulticastTest

* remove empty line to fix lint error

* improve tests
2020-01-02 13:29:53 -05:00
ychescale9
ba3bf9fd2e Misc improvements and cleanups (#47)
* 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.
2019-12-26 13:21:52 -05:00
Yigit Boyar
1dbe5a75c2 unblock upstream when a new downstream arrives (#43)
* Failing test for downstream closing w/o ack

Add test case that fails when a downstream closes w/o acking the message
and indefinitely suspending the stream for other active downstreams

Issue: #41

* add test with buffer

* ack latest message when a new upsteam arrives

Previously, a new downstream would be suspended on the ack of
messages that arrived before it, even when buffer is 0.

This PR changes that behavior such that if there is no buffer,
we ack latest message immediately so that new downstream can
get values instead of waiting for values that it'll never receive

* re-apply ktlint
2019-12-20 20:19:41 -05:00
Eyal Guthmann
1a1eb00673 Hide use of actor in ChannelManager (#33)
* Have ChannelManager delegate to an actor rather then implementing one

* update documentation

* Update multicast/src/main/kotlin/com/dropbox/flow/multicast/ChannelManager.kt
2019-12-17 17:15:14 -05:00
Burak Eregar
a5f0a29d97 Migrate the rest of the module and remove AssertJ dependency (#32) 2019-12-16 13:04:03 -08:00
Eyal Guthmann
689812a7bb
Clean up ChannelManager's interface to make it easier to add more tests (and add some) (#29)
* Clean up ChannelManager's interface to make it easier to add more tests (and add them)

Main changes:
* ~`ChannelManager` no longer inherits from `StoreRealActor` but rather
delegates to one.~ - Moved to followup PR
* messages coming from the upstream were placed under `Message.Dispach`
rather than `Message`. These are the only messages accepted from outside
`ChannelManager`
* `ChannelManager` now only exposes `plusAsign`, `minusAsign` for
adding/removing channels, close for closing  and send(msg, Message.Dispatch)
for upstream events
* `SharedFlowProducer` no longer has a back dependency on
`ChannelManager`, rather it accepts a `suspend (Message.Dispatch) ->
Unit`
* `ChannelManager` is now built with the upstream flow rather than a
flow factory. Given that a flow is stateless, passing in a flow that can
be re-consumed seems like the simpler API.
* New `ChannelManager` tests

* make changes to existing test minimal

* revert actor delegation to reduce PR size

* comments

* clean up tests

* Bump travis

* lint

* rename `channelManagerInbox` ->``sendUpsteamMessage`
2019-12-16 08:50:57 -08:00
Yigit Boyar
2b70a2f721 Fix multiple collections on Multicast (#28)
* Fix multiple collections on Multicast

Multicast implementation had a bug where the returned flow could
not be collected multiple times as it was using the same channel
it created when  was called.

This PR changes it to create per collection to avoid this issue.

I've also replaced  function with a  field as there
is no reason to keep creating a new one, it can be just a flow

Test: MultiplexTest#multipleCollections
Fixes: #26

* remove create function
2019-12-13 13:08:35 -05:00
ychescale9
8ddbe3c76f Add ktlint and fix all issues. (#11) 2019-12-10 10:51:14 -05:00
David Chang
dce8b865c1 Update maven coordinates for Store 4 2019-12-09 11:39:20 -08:00
Yigit Boyar
6d97c399fa move multicast to its own module (#9)
Fixes #8
2019-12-08 19:12:11 +01:00