#signal #reactive #frp #futures

futures-signals

Zero cost FRP signals using the futures crate

31 releases

0.3.24 Dec 29, 2021
0.3.23 Oct 20, 2021
0.3.22 Jun 13, 2021
0.3.17 Mar 18, 2021
0.1.0 Mar 18, 2018

#44 in Asynchronous

Download history 628/week @ 2021-10-01 818/week @ 2021-10-08 844/week @ 2021-10-15 966/week @ 2021-10-22 662/week @ 2021-10-29 863/week @ 2021-11-05 634/week @ 2021-11-12 307/week @ 2021-11-19 637/week @ 2021-11-26 566/week @ 2021-12-03 459/week @ 2021-12-10 795/week @ 2021-12-17 861/week @ 2021-12-24 781/week @ 2021-12-31 783/week @ 2022-01-07 481/week @ 2022-01-14

3,033 downloads per month
Used in 12 crates (11 directly)

MIT license

245KB
5K SLoC

crates.io docs.rs

This is a Rust crate that provides zero-cost FRP Signals which are built on top of the futures crate.

Hold on, zero-cost? Yup, that's right: if you don't use a feature you don't pay any performance cost, and the features that you do use are as fast as possible. Signals are very efficient.

What is a Signal? It is a value that changes over time, and you can be efficiently notified whenever its value changes.

This is useful in many situations:

  • You can automatically serialize your program's state to a database whenever it changes.

  • You can automatically send a message to the server whenever the client's state changes, or vice versa. This can be used to automatically, efficiently, and conveniently keep the client and server's state in sync.

  • A game engine can use Signals to automatically update the game's state whenever something changes.

  • You can easily represent continuous input (such as the current temperature, or the current time) as a Signal.

  • If you create a GUI, you can use Signals to automatically update the GUI whenever your state changes, ensuring that your state and the GUI are always in sync.

  • You can use dominator to create web apps and automatically keep them in sync with your program's state.

  • And many more situations!

The best way to learn more is to read the tutorial.

Dependencies

~1.2–1.9MB
~40K SLoC

a