Chiχ Group
Example
// Sending componentconst Group = const g = Group // Receiving componentconst Group = const g = Groupg g <-- group start packetg <-- item packetg <-- item packetg <-- group end packet if g
groupBy
Creates SubGroups from incoming groups This works even when the packets are out of order.
Receives a differentiator for the itemId specified within the metadata of the received packet.
This meta data contains an itemId for a specific input group.
This itemId will have to correspond with the received packets on the other port.
When the grouping is done, the collected subgroups are emitted along with their differentiator
This data can be used to send out the groups again.
The groups will be emitted only after all subgroups are complete.
const groupBy = // .. sending node // receive open packetgroupBy // receive packet with differentiatorgroupBy // receive packet incoming packetgroupBy // Listen for group event// group is an array of data, by is the differentiatorgroupBy
Sync
Sync is used to synchronize at least 2 different inputs where both input paths originate from the same group, yet went different paths.
Sync can be used to synchronise the paths again and send out the items in order.
const Sync = const sync = // .. sending node // receive open packetsync // receive packet from port in1sync // receive packet from port in2sync // some more packetssyncsyncsyncsyncsync // receive close packetsyncsync // If ordered is true (the default) a group event is emitted// which contains all items in ordersync // both for unordered and ordered a sync event is emitted// if ordered is true (the default) the events are emitted in order.// else the events are emitted as soon as a combination of packets is ready,// the item order of the original group in this case will not be garanteed.sync