This library was inspired by the more advanced Oz programming language
Dataflow variables have the property that they can only be bound/assigned to once, or have an equivalent value as an existing assignment.
Dataflow variables must be declared before they are used, and can be passed around as data without actually being bound.
If the variable gets used (in this library this means a method call) while being unbound then the currently executing thread will suspend.
Ruby is Object Oriented (with the ability to mutate local, instance, class, and global variables, and even constants), and on top of that it has powerful reflection and meta-programming abilities.
While these features are useful for certain problems, they are not within the declarative model.
Ruby, like many other OO languages, is facing the hurdles of taking advantage of the increase of processor cores within a simple parallel programming model.
This library lets you program Ruby in the declarative concurrent model when you need to take advantage of multiple cores.
The trick to this kind of programming is binding variables from other threads. The nice thing is that many existing libraries/classes/methods can still be used, just avoiding side-effects.
Use regular Ruby threading to create threads, use “local” or “declare” to create new variables, and use “unify” to bind variables.
What's New in This Release: [ read full changelog ]
· Dataflow.forker= for setting custom forkers
· Dataflow#local returns an anonymous variable when called without a block