Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

RxStorage API modification #159

Open
brastak opened this issue Apr 21, 2020 · 3 comments
Open

RxStorage API modification #159

brastak opened this issue Apr 21, 2020 · 3 comments

Comments

@brastak
Copy link
Contributor

brastak commented Apr 21, 2020

I have 2 proposals about RxStorage API:

  1. change signature of list(Key) method: why we don't use Flowable? It fits better rx nature, in my opinion.
  2. add error-free value() method. Currently we need to use exists().andThen(value()) approach to be sure that object exists in the storage. We can alter value() method to return Maybe (or we can add new method).
@0crat
Copy link

0crat commented Apr 21, 2020

@g4s8/z please, pay attention to this issue

@g4s8
Copy link
Member

g4s8 commented Apr 23, 2020

@brastak I agree about 1 point. Also, I'd change Storage.value method to and return just Publisher without CompletableFuture.

But I don't really like 2 (error-free value), I think RxStorage should have same behavior as Storage to avoid confusion but using Rx API

@brastak
Copy link
Contributor Author

brastak commented Apr 23, 2020

@g4s8 Maybe we should change Storage API too? Getting value is our the most used operation, but now we have no way to execute it with one call. We should check key for existing firstly, and then retrieve. We provoke clients to use just Storage.value and handle exception (because of it should work almost 2 times faster) that does not look like good code design

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

No branches or pull requests

3 participants