Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default value for a port?

Tags:

noflo

Is it possible to set a default value or an IIP (Initial Information Packet) for a port via Coffee/Javascript?

Often it would be nice to set a default value for a port so that there's some initial data to start with.

like image 392
MikkoH Avatar asked Dec 12 '25 06:12

MikkoH


1 Answers

Yes, this is a new feature that will ship in NoFlo 0.5. Using the new Port API, noflo.InPort instances will send the value received via the default port options key when started.

So, something like:

noflo = require 'noflo'
exports.getComponent = ->
  new noflo.Component
    inPorts:
      foo:
        datatype: 'string'
        default: 'baz'
like image 150
bergie Avatar answered Dec 14 '25 06:12

bergie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!