Search code examples
noflo

Can I Write noflo Component by C++?


I have a local system which is written by C++.

I want to integrate noflo with my system,so I want to write a component(by C++) to fetch data from my system to noflo,and write another component(by C++) to provide data from noflo to my system.


Solution

  • You cannot directly write a NoFlo component in C++, as NoFlo is a JavaScript library.

    If you are using NoFlo on Node.js, you can create a node.js C++ addon, and then use the JS API in your NoFlo component. If you are using NoFlo on browser, you can use Emscripten to compile your C++ into JS.

    Other mechanisms of communicating from a NoFlo program with C++ code include:

    • Running the C++ code as a subprocess, and communicate over stdin/stdout. See gmr-saliency example.
    • Communicate between NoFlo and your system using a standard message broker like AMQP or MQTT. MsgFlo and msgflo-cpp is designed created to help with that. Recommended for distributed systems.
    • Implementing the FBP runtime protocol and using noflo-runtime/RemoteSubgraph to communicate with it. Documentation currently missing