ZenFlo

Flow-based programming for Haxe
https://github.com/zenturi/ZenFlo

To install, run:

haxelib install ZenFlo 0.0.2 

See using Haxelib in Haxelib documentation for more information.

README.md

ZenFlo

Flow Based Programming Kit.

ZenFlo is an implementation of flow-based programming for Haxe running on and expected to run on all Haxe targets. It is a port of the NoFlo library.

Scope

ZenFlo is a way to coordinate and reorganize data flow in any application. If you are building no-code/low-code programs or editors, ZenFlo handles that. Each node is a black-box or small unit of your program, and ZenFlo helps you connect these nodes in such a way that they are portable and reusable.

Dependencies

This project uses lix.pm as Haxe package manager. Run npm install to install the dependencies.

Run Tests

npx run haxe test.hxml

Usage

Read the NoFlo Documentation on how components are loaded.

To convert an Haxe function into a ZenFlo component:

import zenflo.lib.loader.ManifestLoader;
import zenflo.lib.Macros.asComponent;
import zenflo.lib.Macros.asCallback;
import zenflo.lib.Utils.deflate;

ManifestLoader.init();
final loader = new ComponentLoader(Sys.getCwd()));
final component = (_) -> asComponent(deflate(Math.random), {});
loader.registerComponent('math', 'random', component, (e) -> done());

loader.load('math.random').handle(cb -> {
    switch cb {
        case Success(_): {
            final wrapped = asCallback('math.random', {loader: loader});
            wrapped('bang', (err, res) -> {
                if (err != null) return;
                trace(Std.isOfType(res, Float)); // True
            });
        }
        case Failure(err):{
            // throw error
        }
    }
});

See the Component Spec for more examples of how components send data to eachother.

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub