All Projects → rxRust → Rxrust

rxRust / Rxrust

Licence: mit
Rust implementation of Reactive Extensions.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rxrust

WebsocketClientLite.PCL
websocket Client Lite PCL - Xaramrin
Stars: ✭ 22 (-94.15%)
Mutual labels:  reactivex, rx
Rxcommon
Multiplatform implementation of ReactiveX providing a common way to build one set of business logic for native, iOS, Javascript, Android, JVM, and other platforms.
Stars: ✭ 83 (-77.93%)
Mutual labels:  rx, reactivex
Flutter validation login form bloc pattern rxdart
[Functional reactive programming (FRP)]💧 💧 💧 [Pure RxDart] Validation login form by using the BLoC pattern with RxDart - A new Flutter project featuring a faked authentication interface to demonstrate validation. Implemented with BloC pattern.
Stars: ✭ 45 (-88.03%)
Mutual labels:  rx, reactivex
flutter-form-with-validation-BLOC
This form and validation functions are created by using the BLOC pattern with RxDart instead of using StatefulWidget
Stars: ✭ 63 (-83.24%)
Mutual labels:  reactivex, rx
purescript-outwatch
A functional and reactive UI framework based on Rx and VirtualDom
Stars: ✭ 33 (-91.22%)
Mutual labels:  reactivex, rx
Rx.Http
A reactive way to make HTTP Request in .NET Core 🚀
Stars: ✭ 62 (-83.51%)
Mutual labels:  reactivex, rx
Dynamicdata
Reactive collections based on Rx.Net
Stars: ✭ 1,083 (+188.03%)
Mutual labels:  rx, reactivex
Pharmacist
Builds observables from events.
Stars: ✭ 221 (-41.22%)
Mutual labels:  reactivex, rx
rx
Reactive Extensions for D Programming Language
Stars: ✭ 52 (-86.17%)
Mutual labels:  reactivex, rx
rx-reason
Reactive programming library for ReasonML/OCaml
Stars: ✭ 49 (-86.97%)
Mutual labels:  reactivex, rx
rxkotlin-jdbc
Fluent RxJava JDBC extension functions for Kotlin
Stars: ✭ 27 (-92.82%)
Mutual labels:  reactivex, rx
Web3j
Lightweight Java and Android library for integration with Ethereum clients
Stars: ✭ 3,537 (+840.69%)
Mutual labels:  reactivex
bx-docker
Tutorial on how to build Docker Images for the IAR Build Tools on Linux hosts. The IAR Build Tools on Linux are available for Arm, RISC-V and Renesas (RH850, RL78 and RX).
Stars: ✭ 28 (-92.55%)
Mutual labels:  rx
BIMCV-COVID-19
Valencia Region Image Bank (BIMCV) that combines data from the PadChest dataset with future datasets based on COVID-19 pathology to provide the open scientific community with data of clinical-scientific value that helps early detection of COVID-19
Stars: ✭ 105 (-72.07%)
Mutual labels:  rx
Awesome Rxjs
A collection of awesome RxJS resources
Stars: ✭ 314 (-16.49%)
Mutual labels:  reactivex
Protein
💊 Protein is an IntelliJ Plugin to generate Kotlin code for Retrofit 2 and RxJava 2 based on a Swagger definition
Stars: ✭ 273 (-27.39%)
Mutual labels:  reactivex
RxSocket
RxSocket连接
Stars: ✭ 31 (-91.76%)
Mutual labels:  rx
TMDbMultiplatform
Step-by-step guide on Kotlin Multiplatform
Stars: ✭ 86 (-77.13%)
Mutual labels:  rx
reactor-go
A golang implementation for reactive-streams.
Stars: ✭ 48 (-87.23%)
Mutual labels:  reactivex
Rxgo
Reactive Extensions for the Go language.
Stars: ✭ 3,907 (+939.1%)
Mutual labels:  reactivex

rxRust: a zero cost Rust implementation of Reactive Extensions

codecov

Usage

Add this to your Cargo.toml:

[dependencies]
rxrust = "0.10.0"

Example

use rxrust:: prelude::*;

let mut numbers = observable::from_iter(0..10);
// crate a even stream by filter
let even = numbers.clone().filter(|v| v % 2 == 0);
// crate an odd stream by filter
let odd = numbers.clone().filter(|v| v % 2 != 0);

// merge odd and even stream again
even.merge(odd).subscribe(|v| print!("{} ", v, ));
// "0 1 2 3 4 5 6 7 8 9" will be printed.

Clone Stream

In rxrust almost all extensions consume the upstream. So when you try to subscribe a stream twice, the compiler will complain.

 # use rxrust::prelude::*;
 let o = observable::from_iter(0..10);
 o.subscribe(|_| { println!("consume in first")} );
 o.subscribe(|_| { println!("consume in second")} );

In this case, we must clone the stream.

 # use rxrust::prelude::*;
 let o = observable::from_iter(0..10);
 o.clone().subscribe(|_| {println!("consume in first")});
 o.clone().subscribe(|_| {println!("consume in second")});

Scheduler

rxrust use the runtime of the Future as the scheduler, LocalPool and ThreadPool in futures::executor can be used as schedulers directly, and tokio::runtime::Runtime also supported, but need enable the feature futures-scheduler. Across LocalScheduler and SharedScheduler to implement custom Scheduler.

use rxrust::prelude::*;
use futures::executor::ThreadPool;

let pool_scheduler = ThreadPool::new().unwrap();
observable::from_iter(0..10)
  .subscribe_on(pool_scheduler.clone())
  .map(|v| v*2)
  .to_shared()
  .observe_on(pool_scheduler)
  .to_shared()
  .subscribe(|v| {println!("{},", v)});

Converts from a Future

just use observable::from_future to convert a Future to an observable sequence.

use rxrust::prelude::*;
use futures::{ future, executor::LocalPool };

let mut local_scheduler = LocalPool::new();
observable::from_future(future::ready(1), local_scheduler.spawner())
  .subscribe(move |v| println!("subscribed with {}", v));

// Wait `LocalPool` finish.
local_scheduler.run();

A from_future_result function also provided to propagating error from Future.

Missing Features List

See missing features to know what rxRust does not have yet.

All contributions are welcome

We are looking for contributors! Feel free to open issues for asking questions, suggesting features or other things!

Help and contributions can be any of the following:

  • use the project and report issues to the project issues page
  • documentation and README enhancement (VERY important)
  • continuous improvement in a ci Pipeline
  • implement any unimplemented operator, remember to create a pull request before you start your code, so other people know you are work on it.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].