noflo-core
Version:
NoFlo Essentials
29 lines (23 loc) • 749 B
text/coffeescript
noflo = require 'noflo'
class Repeat extends noflo.Component
description: 'Forwards packets and metadata in the same way it receives them'
icon: 'forward'
constructor: ->
= new noflo.InPorts
in:
datatype: 'all'
description: 'Packet to be forwarded'
= new noflo.OutPorts
out:
datatype: 'all'
.in.on 'connect', =>
.out.connect()
.in.on 'begingroup', (group) =>
.out.beginGroup group
.in.on 'data', (data) =>
.out.send data
.in.on 'endgroup', =>
.out.endGroup()
.in.on 'disconnect', =>
.out.disconnect()
exports.getComponent = -> new Repeat()