-
Notifications
You must be signed in to change notification settings - Fork 660
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
RxJava2 Module #407
RxJava2 Module #407
Conversation
This also means that all those classes which are implementing Cancelable interface now have to check in the callback for asynchronous ops if the this operation has been cancelled or not and then only proceed forward.
…llo-android into issue-apollographql#345
Remove toFlowable which I feel is not required
… issue-apollographql#345 Conflicts: apollo-runtime/src/main/java/com/apollographql/apollo/internal/RealApolloCall.java apollo-runtime/src/main/java/com/apollographql/apollo/internal/RealApolloPrefetch.java apollo-runtime/src/main/java/com/apollographql/apollo/internal/RealApolloWatcher.java
…pollo-android into issue-apollographql#345
apollo-rx2support/gradle.properties
Outdated
POM_ARTIFACT_ID=compiler | ||
POM_NAME=Apollo Android Compiler | ||
POM_DESCRIPTION=Implementation for the Gradle plugin | ||
POM_PACKAGING=jar |
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.
Shouldn't it be aar since it depends on apollo runtime which is aar
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.
Yep it should be aar. Also need to make changes to the other variables. Pushing it.
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.
it should be jar, and pure java module due to:
#409
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.
Cool, I'll change it to jar
} | ||
|
||
/** | ||
* Converts an {@link ApolloPrefetch} to an asynchronous 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.
technically the Observable is not async, it has a callback but until someone uses a scheduler everything with still run synchronous by default
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 I meant ApolloWatcher here not ApolloPrefetch. But the thing with this observable is that clients don't block when they subscribe to it. So that's why I used async 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.
It would be nice to add example to sample project that uses rx (future pr)
@digitalbuddha Yeah, I'll just create an issue and start work on it once this gets merged. |
Lgtm |
You need to exclude rxjava.properties from apk to make build pass |
Fixed the duplicate file exception by adding the following line to apollo-integration's build.gradle
@digitalbuddha Also wanted to know what kind of examples do you want me to add to the sample module. Do you want me to just add a simple Rx example for apollocall or you want me to add examples of other apollo types as well? |
Just a simple example would be fine showing how to get an observable, how to subscribe to it and how to unsubscribe on destroy. Hmm CI still failing with weird errors not sure why :-/ |
apollo-rx2support/build.gradle
Outdated
apply plugin: 'com.android.library' | ||
clearSkipApolloRuntimeDep() | ||
|
||
android { |
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.
pls convert this module to pure java, as runtime and api right now java modules
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.
Changed it to pure Java module
@digitalbuddha The builds are failing with a 137, which is an indication that the gradle process was killed by SIGKILL and is likely due to out of memory issues. Should we try increasing the heap size? |
Closes #345
Added Rx2 wrappers for the following classes in a separate module for Rx2 types:
Felt that there is no need for an explicit function to get a backpressure supported Rx2 type for ApolloWatcher as we can always convert an Observable to a Flowable with toFlowable method on it.