-
Notifications
You must be signed in to change notification settings - Fork 329
RxJava conversion #387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RxJava conversion #387
Conversation
Unfortunately I cannot see the merge conflict. |
Probably the changes i made to the Map class |
Yup, merging them now |
@@ -0,0 +1,28 @@ | |||
package com.pokegoapi.util; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add license header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, didn't run Checkstyle yet. First prio, solve merge issue. Will fix headers right after that. Likely more is wrong/missing
@Grover-c13 If this branch does't get merged, I noticed you added a DummyFuture, but you can also use com.pokegoapi.util.FutureWrapper#just, doing exactly the same. |
oh ty will remember |
@@ -457,7 +458,7 @@ protected CatchItemResult handle(ByteString result) throws RemoteServerException | |||
* @throws RemoteServerException if the server failed to respond | |||
*/ | |||
public CatchItemResult useItem(ItemId item) throws LoginFailedException, RemoteServerException { | |||
return useItemAsync(item).toBlocking(); | |||
return AsyncHelper.toBlocking(useItemAsync(item)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Async helper could also return a observable transformer. So that compose(AsyncHelper.toBlocker()) would be Cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How's a transformer going to help in this situation? The goal is to unwrap the Observable and handle all RuntimeExceptions to throw their checked versions. A transformer will return another Observable, which is exactly not what I need or am I missing some other usage of a transformer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that a transformer will not return a modified version of the observable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a transformer can´t change the type of a observable to this isn´t possible right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see what you mean now. Extend observable and return that. That would be nice indeed
esac | ||
|
||
# Attempt to set APP_HOME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradlew script was updated somehow, is this an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its because you changed the gradle wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must have been my IDE. Nothing intentionally. I will revert it
@mashurex when youre around can i get your opinion on this |
I think this shows promise. I've gotten Observables working in my branch but I don't like the direction I've headed. Also, I've gotten swamped and it's going to take me too long to make this conversion- I think we should go with this and I'll pitch in on it and kill my PR. |
I've tested this branch and it works just as good as the current Development branch. |
Well merge after 0.3 |
Maybe it's possibe to merge it into another branch in this repo? Keeping this branch up to date is quite some work :) |
I will wait until this is merged before i refactor the modules. |
@Grover-c13 can you merge this now? |
merged to dev |
should i start the new branch now or merge the other prs first? |
the other PR's have conflicts and i dont want to deal with that right now due to some unrelated issues going from dev to master <_< They are minor anyway |
Hi all,
After the first Future based implementation for async and throttling, this is the same but based on Observables. I don't know if this fits into the already existing attempt to move to RxJava. Because it again is set up transparently it may be a good start.
This is PR for concideration. No hard feelings if it won't be merged.