ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - alfert/reaxive: Reactive Extensions for Elixir
Reactive Extensions for Elixir. Contribute to alfert/reaxive development by creating an account on GitHub.
Visit Site

GitHub - alfert/reaxive: Reactive Extensions for Elixir

GitHub - alfert/reaxive: Reactive Extensions for Elixir

Reaxive

Build Status Coverage Status hex.pm version Inline docs

Reaxive is a reactive event handling library, inspired by Elm (http://elm-lang.org) and Reactive Extensions. It implements the kind of asynchronous collections José Valim talked about in his keynotes on ElixirConf2014 and ElixirConfEU 2015.

Usage

Preparations

To use Reaxive you have to add it to your Mix dependencies

	deps: [
		{:reaxive, "~> 0.1.0"}
	]

and add the reaxive and the logger application to your required applications

applications: [:kernel, :reaxive, :logger]

Using Reaxive

Now you can use Reaxive. All the combinators are defined in the module Reaxive.Rx (see http://hexdocs.pm/reaxive/). Basically, they follow the naming scheme from other reactive frameworks, such as Reactive Extensions (.NET), RxScala or RxJS. Hence the wonderful marble diagrams of RX (see e.g. http://rxmarbles.com/) can be used to understand the combinators' semantics.

	alias Reaxive.Rx
	1..100
	|> Rx.generate
	|> Rx.map(&(&+1))
	|> Rx.filter(&Integer.is_odd/1)
	|> Rx.as_text
	|> Rx.sum

The combinators are building a pipeline for event processing spawing new processes on-demand. Adhering to the protocol should be sufficient that these processes are automatically stopped again. This is extremely important, since otherwise we get a process leak in our system which will eat up all system resources.

The protocols, which lay the foundation for Reaxive, can also be found at http://hexdocs.pm/reaxive/ .

Future Development Steps

Important tasks for the future are:

  • simpily and streamline the implementation
  • add more of the missing combinators
  • develop a concept of when and how to integrate with OTP Supervision
  • gain experience of using in Reaxive, .e.g by applying to Phoenix Channels
  • apply property based testing (using PropEr?)
  • apply the dialyzer

History

The v0.1.0 series supports Elixir 1.1.0 and later.

In the v0.0.3 series, we introduce cancellable generators. We also implement José Valim's async operator to break a synchronous pipeline into asynchronuous pieces

Subjects are a re-implementation of Rx.Impl. Major ideas:

  • separate subscription handling from event handling
  • subscriptions
    • implement the boolean predicate is_unsubscribed as shown in the slides
    • functions for adding and removing subscribers from a subscription
  • can subscriptions be implemented without a GenServer?
  • event handling should be done in a pure functional setting with explicit accumulators
    • Re-use compose and the Rx.Sync functions as combinators
    • combinators operate on a Observeable
    • Send composed events to subscribers
  • we need a better mechanism to automatically stop processes or to detect that they not running any more (==> monitoring or providing a general abstraction for calling functions on not-existing gen-servers)

The first code version (v0.0.1) has conceptual problems which showed up during testing. As any observable lives in its own process, we have maxium of concurrency. This results in pushing events from the front while later transformations are not properly setup. Due to this, some of the first events may be swallowed and disappear, so the tests fail because not all events are piped through the entire sequence of transformation.

The code v0.0.2 series is a major rework that implements ideas of

and also inspired by Clojure's transducers introduced by Rich Hickey

Contributing

Please use the GitHub issue tracker for

  • bug reports and for
  • submitting pull requests

License

Reaxive is provided under the Apache 2.0 License.

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory