noflo / noflo-runtime-base

Base library for building NoFlo runtimes
11 stars 12 forks source link

How to use this? #354

Open linonetwo opened 12 months ago

linonetwo commented 12 months ago

I'm now planning to create a basic UI, and JSON stringify result, send to backend using custom REST API, and use another API to execute flow on backend.

Can this package save me some time? How to use this?

linonetwo commented 12 months ago

By inspect the The noflo-nodejs command line execution flow:

  1. Read the file path from the command line arguments and load it as a Graph object using the fbp-graph library.
  2. Start a local socket server for your own local connection or flowhub connection.
  3. Listen for changes to the graph via runtime.graph.registerGraph, broadcast them, and set them to the current mainGraph to be returned at a future getRuntime.
    1. Who will chage the local graph and why does it change? I think it's all done by the remotes, probably to synchronize with all the other remotes if one of them does something locally.
    1. It looks like a runtime can only have one graph? So if you want to execute multiple graphs in the background, you need to start multiple runtimes, but maybe that's just for development, production can run multiple graphs directly with the noflo package.

It should be possible to do without the logic here, since it is mainly for remote connection to flowhub development and supports broadcasting to multiple collaborations.

If we have our own embedded diagram editor and are single-user, we can just save and execute the diagrams ourselves.

We'll add the runtime and fbp protocol stuff back in when we need to do multiplayer collaboration.