Performing Comparisons in NoFlo
Want to see pretty graphs? Log in now!
npm install noflo-compare
|31||downloads in the last month|
|Last Published By|
|Version||0.2.0 last updated 8 months ago|
|Keywords||noflo, compare, utilities|
|Dependencies||noflo, underscore, noflo-swiss, noflo-cache|
This package provides utility components to compare between two or more connections within a NoFlo program.
Feel free to contribute new components and graphs! I'll try to incorporate as soon as time allows.
Accept two streams of packets. Only the one with packets "winning" the packets of the other stream gets passed to the 'OUT' port.
The comparison is done on a packet-to-packet basis. For instance, for the following streams,
First Stream: C, D, 3, H Second Stream: A, B, 4, G
The first stream would win because
C > A,
D > B, and
H > G even
3 < 4. The stream with the most winning packets gets forwarded.
If the number of packets doesn't match, comparison would be performed only up to the last packet of the shorter stream. For instance,
First Stream: C, D, 3, H Second Stream: A, B, 4, G, Z, Z, Z, Z
Only the first four are compared and the result is the same as before.
- IN: streams of packets to be compared
- OUT: the winning stream of the couple of streams passed to 'IN'
Compare two streams and output the first one.
'C\nD\n3\nH\nZ\nZ' -> IN SplitA(core/SplitStr) OUT -> IN AllPackets(compare/AllPackets) 'A\nB\n4\nG' -> IN SplitB(core/SplitStr) OUT -> IN AllPackets() OUT -> IN Output(core/Output)