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

Remove usages of rxscala and replace with Java based code. #4744

Merged
merged 3 commits into from
Nov 22, 2019

Conversation

markusthoemmes
Copy link
Contributor

Description

RxScala has been abandoned: ReactiveX/RxScala#244. To unblock the move to Scala 2.13, this removes all usages of it and replaces it with Java interoperable code.

Related issue and scope

Ref #4741

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).

@codecov-io
Copy link

codecov-io commented Nov 21, 2019

Codecov Report

Merging #4744 into master will increase coverage by 35.92%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #4744       +/-   ##
===========================================
+ Coverage   42.38%   78.31%   +35.92%     
===========================================
  Files         191      198        +7     
  Lines        8564     8830      +266     
  Branches      609      623       +14     
===========================================
+ Hits         3630     6915     +3285     
+ Misses       4934     1915     -3019
Impacted Files Coverage Δ
...core/database/cosmosdb/RxObservableImplicits.scala 0% <0%> (ø) ⬆️
...hisk/core/monitoring/metrics/OpenWhiskEvents.scala 94.11% <0%> (ø)
...penwhisk/core/monitoring/metrics/MetricNames.scala 100% <0%> (ø)
...k/core/monitoring/metrics/PrometheusRecorder.scala 81.41% <0%> (ø)
...pache/openwhisk/core/monitoring/metrics/Main.scala 0% <0%> (ø)
...nwhisk/core/monitoring/metrics/KamonRecorder.scala 83.63% <0%> (ø)
.../core/monitoring/metrics/PrometheusEventsApi.scala 90% <0%> (ø)
...nwhisk/core/monitoring/metrics/EventConsumer.scala 87.27% <0%> (ø)
...openwhisk/common/tracing/OpenTracingProvider.scala 21.15% <0%> (+1.92%) ⬆️
...re/database/MultipleReadersSingleWriterCache.scala 98% <0%> (+2%) ⬆️
... and 134 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94043db...8ff9791. Read the comment docs.

@@ -34,8 +34,12 @@ private[cosmosdb] trait RxObservableImplicits {
* @return the head result of the [[Observable]].
*/
def head(): Future[T] = {
def toHandler[T](f: (T) => Unit): Action1[T] = new Action1[T] {
Copy link
Member

Choose a reason for hiding this comment

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

May be simplify it further with SAM. Also using P instead of T as Intellij warned of shadowing here

def toHandler[P](f: (P) => Unit): Action1[P] = (t: P) => f(t)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! You can tell my scala is a little on the rusty side 😂

Copy link
Member

@chetanmeh chetanmeh left a comment

Choose a reason for hiding this comment

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

Good to get rid of a third party dependency which is not maintained. Thanks @markusthoemmes !

@markusthoemmes
Copy link
Contributor Author

@chetanmeh told me to merge myself so here we go!

@markusthoemmes markusthoemmes merged commit d3bb290 into apache:master Nov 22, 2019
@sinwe
Copy link

sinwe commented Feb 10, 2020

@markusthoemmes
Copy link
Contributor Author

@sinwe Not sure if that matches up with our usage of reactivex here. I mostly wanted to get rid of the one dependency I removed here without changing the code too much, so this was the quickest way.

@sinwe
Copy link

sinwe commented Feb 10, 2020

@markusthoemmes if your usage of rxscala is not that much, it's not worth to add additional dependencies. However if you use rxscala extensively and you want to keep track as it progress, e.g: scala 2.13, etc, then it's better you invest some time to replace the dependency completely with another one. There are many libraries similar to rxscala, e.g: Monix, Reactor, etc.

@markusthoemmes
Copy link
Contributor Author

The code here is purely adaptor code for the CosmosDB lib though, so we have no choice other than using what they use.
OpenWhisk itself uses plain Futures and various akka libs.

@sinwe
Copy link

sinwe commented Feb 10, 2020

Then you've done the right thing :)

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