noflo-core
Version:
NoFlo Essentials
24 lines (20 loc) • 697 B
text/coffeescript
noflo = require 'noflo'
class DisconnectAfterPacket extends noflo.Component
description: 'Forwards any packets, but also sends a disconnect after each of them'
icon: 'pause'
constructor: ->
= new noflo.InPorts
in:
datatype: 'all'
description: 'Packet to be forward with disconnection'
= new noflo.OutPorts
out:
datatype: 'all'
.in.on 'begingroup', (group) =>
.out.beginGroup group
.in.on 'data', (data) =>
.out.send data
.out.disconnect()
.in.on 'endgroup', =>
.out.endGroup()
exports.getComponent = -> new DisconnectAfterPacket