Flow-based programming for JavaScript
createNetwork
and asCallback
now accept a flowtrace
option to pass a Flowtrace instance for retroactive debugging. Example:const { Flowtrace } = require('flowtrace');
const tracer = new Flowtrace();
noflo.createNetwork(myGraph, {
flowtrace: tracer,
}, (err, network) => {
// ... console.log(tracer.toJSON());
});
createNetwork
now accepts componentLoader
and baseDir
via options. Passing them via Graph properties is deprecatedcreateNetwork
now defaults to the non-legacy "network drives graph" modecreateNetwork
now only supports the graph, options, callback
signature, no options given in some other ordernoflo.Network
interface has been removed. Use createNetwork
to instantiate networksnew noflo.Network
. Use noflo.createNetwork
instead, with the following options available:subscribeGraph: true
: Uses LegacyNetwork
which modifies network topology based on changes in graph. This can cause some types of errors to be silent.subscribeGraph: false
: Uses Network
: network topology can be changed with network's methods (addNode
, removeEdge
, etc) and will be also written to the graph. For backwards compatibility reasons, subscribeGraph
defaults to true
. Adapt your applications to use false
instead and start utilizing Network methods for any changes to a running graph.noflo.createNetwork(graph, options, callback)
signature, with backwards compatibility for the legacy noflo.createNetwork(graph, callback, options)
signaturenoflo.WirePattern
. WirePattern has been deprecated since 1.0, and all code using it should be migrated to the latest Process APIComponentName::icon = 'new-icon'
). Component icon and description should be set in class constructor or in getComponent
instead. Changing icon and description for a specific instance (process) is not affected and is fully supportednetworkCallback
option for noflo.asCallback
to provide access to the network instance for debugging purposesAdded support for running arbitrary NoFlo graphs via noflo.asCallback
. You can call this function now with either a component name, or a noflo.Graph
instance
noflo.AsyncComponent
class -- use WirePattern or Process API insteadnoflo.ArrayPort
class -- use InPort/OutPort with addressable: true
insteadnoflo.Port
class -- use InPort/OutPort insteadnoflo.helpers.MapComponent
function -- use WirePattern or Process API insteadnoflo.helpers.WirePattern
legacy mode -- now WirePattern always uses Process API internallynoflo.helpers.WirePattern
synchronous mode -- use async: true
and callbacknoflo.helpers.MultiError
function -- send errors via callback or error portnoflo.InPort
process callback -- use Process APInoflo.InPort
handle callback -- use Process APInoflo.InPort
receive method -- use Process API getX methodsnoflo.InPort
contains method -- use Process API hasX methodsEXPORTS
mechanism -- disambiguate with INPORT/OUTPORTscoped: false
on an outport will force all packets sent to that port to be unscopedscoped: false
parameter. This is useful for components that mix unscoped and scoped inputsschema
key. Ports with a schema annotate their IP objects automatically with the schema unless the IP object already has a specific schematype
key of ports is now converted to the schema
key. The schema of a port is available via the getSchema()
methodRead the release announcement.
General availability of Process API for NoFlo components
Updated headers to reflect the copyright assignment from The Grid to Flowhub UG
Reimplemented noflo.helpers.MapComponent
to use Process API internally. This helper is deprecated and components using it should be ported to Process API
Reimplemented noflo.helpers.WirePattern
to use Process API internally. To use the original WirePattern implementation, either pass a legacy: true
to WirePattern function or set NOFLO_WIREPATTERN_LEGACY
environment variable
Removed WirePattern receiveStreams
and sendStream
options
Added deprecation warnings to several WirePattern options:
postpone
and resume
. These are still available in legacy mode but will be removed soongroup
collationfield
collationasync: false
optioncomponent.error
method with WirePattern. Use async and error callback insteadcomponent.fail
method with WirePattern. Use async and error callback insteadcomponent.sendDefaults
method with WirePattern. Start your components with a NoFlo network to get defaults sentnoflo.helpers.MultiError
. Use error callback insteadAdded setUp
and tearDown
methods for easier handling of custom states in components. These methods take an asynchronous callback and are recommended to be used instead of start
and shutdown
Added callbacks for component start
and shutdown
methods
Added a clear
method for inports to clear their packet buffer. Used by component shutdown
method
Added addressable port support to Process API
index
attribute of the IP object[portname, index]
. For example: input.getData ['in', 2]
Added callback for Network.stop
Outmost brackets are no longer automatically converted to connect
and disconnect
events. Instead, connect
and disconnect
are injected as needed, but only for subscribers of the legacy events
Added deprecation warnings for APIs that will be removed by NoFlo 1.0. These can be made fatal by setting the NOFLO_FATAL_DEPRECATED
environment variable. These include:
noflo.AsyncComponent
: should be ported to Process APInoflo.helpers.MapComponent
: should be ported to Process APInoflo.ArrayPort
: should be ported to noflo.In/OutPort with addressable: true
noflo.Port
: should be ported to noflo.In/OutPortNetwork.start
or Network.stop
without a callbacknoflo.InPort
process
option: should be ported to Process API or use the handle
optionnoflo.InPort
receive
method: replaced by the get
methodnoflo.InPort
contains
method: replaced by the has
methodnoflo.Graph
exports: use specific inport or outport insteadAdded IP object scope
support to WirePattern
to make WirePattern
components more concurrency-friendly
Removed receiveStreams
option from WirePattern
Graph JSON schema has been moved to https://github.com/flowbased/fbp, and updated with tests.
Added stream helpers for Process API input. hasStream
checks if an input buffer contains a complete stream (matching brackets and data, or only data), getStream
returns a complete stream of packets. These require forwardBrackets
to be disabled for the port.
babel-core was removed as a dependency. Install separately for projects needing ES6 component support
underscore.js was removed as a dependency
input.getData()
in Process API has been changed to fetch only packets of data
type skipping and dropping brackets inbetween
IP objects are strictly required to be of noflo.IP
type
Removed support for deprecated Node.js 0.x versions
NoFlo Graph and Journal were moved to a dedicated fbp-graph library for easier usage in other FBP projects. No changes to NoFlo interface
NoFlo networks now emit packet events only while the network is running
NoFlo networks can show their currently active processes with the getActiveProcesses()
method
ComponentLoader.load
method now calls its callback with the Node.js style error, instance
signature to allow catching component loading issuesgetSource
now returns correct type for graphsconnect
stop
and start
methodsisRunning
methodsetDebug
and getDebug
methodsPorts.add
is now chainablestart
port was removed from subgraphsThese changes mean that in situations where a subgraph is used standalone without a network around it, you need to call component.start()
manually. This is typical especially in unit tests.
read-installed
to the latest versiondropInput
option for WirePattern to drop premature data while parameters not yet received. See #239