The Wayback Machine - https://web.archive.org/web/20220829081106/https://github.com/zenturi/zenflo
Skip to content

zenturi/zenflo

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

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.

About

Flow Based Programming Kit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages