Reactive programming with fibers and dataflow variables
Dataflow programming is one of the simplest forms of reactive programming. In dataflow programming, computations are described by composing variables without bothering about when these variables are set to a value. Such variables are also called dataflow variables, and they will trigger computations that refer to them once they are set. The Pulsar library (https://github.com/puniverse/pulsar) provides a few useful constructs for dataflow programming. These constructs can also be used with Pulsar fibers, which we briefly talked about in Chapter 8, Leveraging Asynchronous Tasks. In this section, we will explore the basics of fibers and dataflow variables from the Pulsar library.
Note
The following library dependencies are required for the upcoming examples:
[co.paralleluniverse/quasar-core "0.7.3"] [co.paralleluniverse/pulsar "0.7.3"]
Your project.clj
file must also contain the following entries:
:java-agents [[co.paralleluniverse...