Guide to Using NoFlo

Publicado el - Última modificación el

NoFlo is a programming environment for Javascript.  It is flow-based, and the logic is basically defined as a graph.  Each node in the graph is an instance of a NoFlo component.  The edges of the graph are used to define the connections that exist between the components.

 

The components are designed to react to incoming packets, or messages that come in a various number of ways.  When a package is received, the component will perform an operation that has been defined previously.  The results are returned as a packet to its output ports.  Components and objects are not shared, so the only way for communication is by sending packets.

 

These NoFlo components are made as Javascript or CoffeeScript classes.  These classes define the input as well as the output ports.  When NoFlo is executed, a live graph is created and the components are instantiated, and then they are connected together,.  Again, you can see the relationships by looking at edges of the graph.

 

NoFlo is designed in such a way that it can handle many different types of input paradigms.  The same NoFlo that reacts to HTTP requests, changes in the file system, and text messages, can also output to a target such as a relational database.  It may also update a dashboard, or respond to an HTTP request.  It is up to the developer to choose the components that are to be used.

 

The Basics of Using NoFlo

 

A developer has a choice of two ways of running NoFlo.  If the whole application is based on flows alone, you may have NoFlo execute it.  This type of NoFlo application is called an independent graph. 

 

If this is not the case, you can embed the NoFlo graphs in an existing Javascript app.  This is done by using it as a Node.js library.  This is one of the better options for developers who are looking to add some new functionality to an existing app.  Examples of this include online billing processes, or rerouting email or SMS within an existing app.

 

Activation Model

 

When a NoFlo network is cranked up, it won't do anything.  The components are loaded and the connections between them are established, but that is it.  Most components require input before they do anything.  The most common way to test or start a NoFlo graph is to send it an initial information packet (IPP).  Sending a file name to a file reader is a good example of this. 

 

In general, a NoFlo graph can be activated by a shell command, or the click of a button.  A flow can also be initiated at a specific time, or time interval, or it can be started based on context such as when a user visits a given web site.

 

If you use Javascript for any of your applications, and may have a need for added functionality either now or in the near future, you as a developer need to become familiar with NoFlo and what it can do for you.

Publicado 22 abril, 2015

Happymarli

Proofreader, Editor, Writer and App Developer

Do you need a professional editor and writer to proofread your technical documents, thesis, novel, statement of purpose, personal statement, resume, cover letter, manuscript, essay, short story, textbook content, or articles? Do you want to make sure that your marketing material content is flawless and appealing to readers? I can do any of that! I am a professional editor (academic, copy, line/su...

Siguiente artículo

CSS Specificity Hacks