{"id":28402401,"url":"https://github.com/reactivex/rxscala","last_synced_at":"2025-06-26T16:32:28.122Z","repository":{"id":19834569,"uuid":"23095928","full_name":"ReactiveX/RxScala","owner":"ReactiveX","description":"RxScala – Reactive Extensions for Scala – a library for composing asynchronous and event-based programs using observable sequences","archived":false,"fork":false,"pushed_at":"2020-01-08T16:00:38.000Z","size":2020,"stargazers_count":887,"open_issues_count":2,"forks_count":112,"subscribers_count":57,"default_branch":"0.x","last_synced_at":"2025-06-01T23:47:55.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ReactiveX.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-19T03:45:33.000Z","updated_at":"2025-05-31T15:36:08.000Z","dependencies_parsed_at":"2022-08-07T09:15:39.624Z","dependency_job_id":null,"html_url":"https://github.com/ReactiveX/RxScala","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/ReactiveX/RxScala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxScala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxScala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxScala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxScala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReactiveX","download_url":"https://codeload.github.com/ReactiveX/RxScala/tar.gz/refs/heads/0.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxScala/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262102512,"owners_count":23259273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-01T15:37:49.400Z","updated_at":"2025-06-26T16:32:28.107Z","avatar_url":"https://github.com/ReactiveX.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RxScala: Reactive Extensions for Scala\n\nThis is a Scala adapter to [RxJava](http://github.com/ReactiveX/RxJava).\n\n# End-of-Life (EOL) notice\n\n**This project is end of life** and new releases will only contain bug-fixes and support for new Scala versions.\nFor more information, see [issue #244](https://github.com/ReactiveX/RxScala/issues/244).\n\nAlternatives to this library:\n\n* [RxJava](https://github.com/ReactiveX/RxJava) (Java, similar API as RxScala)\n* [Reactor](https://projectreactor.io/) (Java)\n* [Akka Streams](https://doc.akka.io/docs/akka/current/stream/index.html) (Scala \u0026 Java)\n* [monix](https://monix.io/) (Scala)\n* [cats-effect](https://typelevel.org/cats-effect/) (Scala)\n* [fs2](https://github.com/functional-streams-for-scala/fs2) (Scala)\n* [ZIO](https://zio.dev/) (Scala)\n\n# Usage\nExample usage:\n\n```scala\nval o = Observable.interval(200 millis).take(5)\no.subscribe(n =\u003e println(\"n = \" + n))\nObservable.just(1, 2, 3, 4).reduce(_ + _)\n```\n\nFor-comprehensions are also supported:\n\n```scala\nval first = Observable.just(10, 11, 12)\nval second = Observable.just(10, 11, 12)\nval booleans = for ((n1, n2) \u003c- (first zip second)) yield (n1 == n2)\n```\n\nFurther, this adaptor attempts to expose an API which is as Scala-idiomatic as possible. This means that certain methods have been renamed, their signature was changed, or static methods were changed to instance methods. Some examples:\n\n```scala\n // instead of concat:\ndef ++[U \u003e: T](that: Observable[U]): Observable[U]\n\n// instance method instead of static:\ndef zip[U](that: Observable[U]): Observable[(T, U)] \n\n// the implicit evidence argument ensures that dematerialize can only be called on Observables of Notifications:\ndef dematerialize[U](implicit evidence: T \u003c:\u003c Notification[U]): Observable[U] \n\n// additional type parameter U with lower bound to get covariance right:\ndef onErrorResumeNext[U \u003e: T](resumeFunction: Throwable =\u003e Observable[U]): Observable[U] \n\n// curried in Scala collections, so curry fold also here:\ndef fold[R](initialValue: R)(accumulator: (R, T) =\u003e R): Observable[R] \n\n// using Duration instead of (long timepan, TimeUnit duration):\ndef sample(duration: Duration): Observable[T] \n\n// called skip in Java, but drop in Scala\ndef drop(n: Int): Observable[T] \n\n// there's only mapWithIndex in Java, because Java doesn't have tuples:\ndef zipWithIndex: Observable[(T, Int)] \n\n// corresponds to Java's toList:\ndef toSeq: Observable[Seq[T]] \n\n// the implicit evidence argument ensures that switch can only be called on Observables of Observables:\ndef switch[U](implicit evidence: Observable[T] \u003c:\u003c Observable[Observable[U]]): Observable[U]\n\n// Java's from becomes apply, and we use Scala Range\ndef apply(range: Range): Observable[Int]\n\n// use Bottom type:\ndef never: Observable[Nothing] \n```\n\nAlso, the Scala Observable is fully covariant in its type parameter, whereas the Java Observable only achieves partial covariance due to limitations of Java's type system (or if you can fix this, your suggestions are very welcome).\n\nFor more examples, see [RxScalaDemo.scala](https://github.com/ReactiveX/RxScala/blob/0.x/examples/src/test/scala/examples/RxScalaDemo.scala).\n\nScala code using Rx should only import members from `rx.lang.scala` and below.\n\n\n## Master Build Status\n\n\u003ca href='https://travis-ci.org/ReactiveX/RxScala/builds'\u003e\u003cimg src='https://travis-ci.org/ReactiveX/RxScala.svg?branch=0.x'\u003e\u003c/a\u003e\n\n## Communication\n\n- [GitHub Issues](https://github.com/ReactiveX/RxScala/issues)\n\n## Versioning\n\n| RxScala version | Compatible RxJava version |\n| ------------------- | ------------------------- |\n| 0.27.* | 1.0.* |\n| 0.26.* | 1.0.* |\n| 0.25.* | 1.0.* |\n| 0.24.* | 1.0.* |\n| 0.23.*\u003csup\u003e[1]\u003c/sup\u003e | 1.0.* |\n| 0.22.0 | 1.0.0-rc.5 |\n| 0.21.1 | 1.0.0-rc.3 |\n| 0.X.Y (X \u003c 21)\u003csup\u003e[2]\u003c/sup\u003e | 0.X.Y |\n\n[1] You can use any release of RxScala 0.23 with any release of RxJava 1.0. E.g, use RxScala 0.23.0 with RxJava 1.0.1 \u003cbr/\u003e\n[2] You should use the same version of RxScala with RxJava. E.g, use RxScala 0.20.1 with RxJava 0.20.1\n\nIf you are using APIs labeled with `Experimental/Beta`, or `ExperimentalAPIs` (deprecated since 0.25.0), which uses RxJava Beta/Experimental APIs,\nyou should use the corresponding version of RxJava as the following table:\n\n| RxScala version | Compatible RxJava version |\n| ------------------- | ------------------------- |\n| 0.26.5 - 0.27.0 | 1.2.4+ |\n| 0.26.4 | 1.2.2+ |\n| 0.26.3 | 1.2.0+ |\n| 0.26.2 | 1.1.6+ |\n| 0.26.1 | 1.1.1+ |\n| 0.26.0 | 1.1.0+ |\n| 0.25.1 | 1.0.17+ |\n| 0.25.0 | 1.0.11+ |\n| 0.24.1 | 1.0.8+ |\n| 0.24.0 | 1.0.7+ |\n\n## Full Documentation\n\nRxScala: \n\n- The API documentation can be found [here](http://reactivex.io/rxscala/scaladoc/index.html#rx.lang.scala.Observable). \n\nNote that starting from version 0.15, `rx.lang.scala.Observable` is not a value class any more.  [./Rationale.md](https://github.com/ReactiveX/RxScala/blob/0.x/Rationale.md) explains why.\n\nYou can build the API documentation yourself by running `sbt doc` in the RxScala root directory. Open `target/scala-2.11/api/index.html` to display it.\n\nRxJava:\n\n- [Wiki](https://github.com/ReactiveX/RxJava/wiki)\n- [Javadoc](http://reactivex.io/RxJava/javadoc/)\n\n## Binaries\n\nBinaries and dependency information for Maven, Ivy, Gradle and others can be found at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7C%22rxscala%22%20AND%20g%3A%22io.reactivex%22).\n\nExample for sbt:\n\n```scala\nlibraryDependencies += \"io.reactivex\" %% \"rxscala\" % \"0.27.0\"\n```\n\nand for Maven:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.reactivex\u003c/groupId\u003e\n    \u003cartifactId\u003erxscala_${scala.compat.version}\u003c/artifactId\u003e\n    \u003cversion\u003e0.27.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nand for Ivy:\n\n```xml\n\u003cdependency org=\"io.reactivex\" name=\"rxscala_${scala.compat.version}\" rev=\"0.27.0\" /\u003e\n```\n\n## Build\n\nTo build you need [sbt](http://scala-sbt.org):\n\n```\n$ git clone git@github.com:ReactiveX/RxScala.git\n$ cd RxScala\n$ TRAVIS_TAG=1.0.0-RC1 sbt package\n```\n\nUse `TRAVIS_TAG` to set the version of the package.\n\nYou can also run the examples from within `sbt`:\n\n```\n$ sbt examples/run\n```\n\nWhen you see the list of available `App` objects pick the one you want to execute.\n\n```\nMultiple main classes detected, select one to run:\n\n [1] AsyncWikiErrorHandling\n [2] SyncObservable\n [3] AsyncObservable\n [4] AsyncWiki\n [5] Transforming\n\nEnter number:\n```\n\n## Bugs and Feedback\n\nFor bugs, questions and discussions please use the [Github Issues](https://github.com/ReactiveX/RxScala/issues).\n\n## LICENSE\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\u003chttps://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactivex%2Frxscala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactivex%2Frxscala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactivex%2Frxscala/lists"}