Skip to content
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

Kotlin Language Adaptor #292

Closed
wants to merge 7 commits into from
Closed

Kotlin Language Adaptor #292

wants to merge 7 commits into from

Conversation

MarioAriasC
Copy link
Contributor

Langauge adaptor for kotlin

@cloudbees-pull-request-builder

RxJava-pull-requests #165 FAILURE
Looks like there's a problem with this pull request

@MarioAriasC
Copy link
Contributor Author

Is a problem with the Perm-Gen memory size when compiling the scala module after you download the kotlin libraries for the first time. The problem disappear growing up the Perm-Gen size, or running the whole process a second time

@benjchristensen
Copy link
Member

Thank you for submitting this, I am not ignoring it due to lack of interest, I'm just overly busy at the moment but I will get around to this!

@MarioAriasC
Copy link
Contributor Author

No problem

@codefromthecrypt
Copy link

@MarioAriasC you might want to redo this on a feature branch as there's a lot of clutter (merge commits, whoops I forgot this) here. I'll review anyway, but we are interested in merging concise, complete commits. make sense? Let me know if you need git syntax help.

@@ -0,0 +1,59 @@
buildscript {
repositories {
mavenCentral()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed by Kotlin Gradle plugin

@codefromthecrypt
Copy link

looks good to me. sufficient unit tests, etc. cleanup the files, build.gradle, and commit, then ask @benjchristensen!

dependencies {
compile project(':rxjava-core')
compile 'org.jetbrains.kotlin:kotlin-stdlib:0.5.748'
provided 'junit:junit-dep:4.10'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at your source, I don't see use of junit outside tests, mark this testCompile

@MarioAriasC
Copy link
Contributor Author

@adriancole Any help with git syntax (and other things) will be very appreciated

@codefromthecrypt
Copy link

sure.

It looks like you are 7 commits ahead of master (merges plus the other things you've added)

do git reset HEAD~7 which should unstage your changes.

Then, you do git pull upstream master to reset your head to latest.
Then, redo your commit, and you'll need to do git push -f origin master to overwrite the commits here.

hope this helps.

@benjchristensen
Copy link
Member

We are getting very close to being able to pull this in (with some refactoring) now that pull #300 is coming.

@benjchristensen
Copy link
Member

Does Kotlin support closure/function coercion like Java 8 or Groovy 2.2 (http://docs.codehaus.org/display/GROOVY/2013/07/09/First+beta+of+Groovy+2.2+available) or allow dynamic generation of extension methods?

I see that Kotlin has extension methods, but every method must be defined manually.

I'm interested in a mechanism to automatically coerce from Kotlin functions to RxJava Function/Action classes, or dynamically generate the extension methods. Here's how I generate the extension methods dynamically in Groovy: https://github.com/Netflix/RxJava/blob/master/language-adaptors/rxjava-groovy/src/main/java/rx/lang/groovy/RxGroovyExtensionModule.java#L84

@benjchristensen
Copy link
Member

For background on the previous questions and why it has been so long in responding to this pull request look at release 0.11.0 which significantly changes how we do language adaptors: https://github.com/Netflix/RxJava/releases/tag/rxjava-0.11.0

@MarioAriasC
Copy link
Contributor Author

Kotlin support function coercion is called SAM (Single Abstract Method) Conversions, this support was introduced in M5.2 and completed in M6 http://blog.jetbrains.com/kotlin/2013/08/kotlin-m6-is-here/

Personally I used it in other project and works fine, but sometimes the compiler can infer the actual type of the interface, in those cases we could fall back on Extension methods.

@benjchristensen
Copy link
Member

That sounds like it could "just work" without anything special then. If not then perhaps the extension methods can fix where we have issues.

Can you give it a try against the new rxjava-core? If coercion is all that's needed then it's simple. If you find issues and extension methods would help, or there are extras that would benefit Kotlin (make it more idiomatic etc) that can be added through a utility class, extension methods etc, it would be great to get an updated pull request.

If nothing else, examples of Kotlin code using RxJava would be great if coercion handles all needed cases.

@MarioAriasC
Copy link
Contributor Author

@benjchristensen I'll close this pull request and open a new one. I have several problems with Git and gradle related to my changes.

I want to start fresh, will be more easy for all of us

@MarioAriasC MarioAriasC closed this Sep 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants