I'm having some problems in program design. I've a stream of data (array in my case), I would like to have multiple processing on each element.
e.gstream --> | processor 1| ---> | processor 2| ----> .etc sub processor_1 (@) { } sub processor_2 (@) { }
Let's say processor 1 is a counter that counts element type. processor 2 is looking for min, max elements in stream. Also I have already separate function for processor 1 and 2 that works on array. Is there any way to compose these 2 functions?
I don't want to use a big for loop. map won't work either. I think what I want is called 1 producer, multiple consumers.?
Thanks! BagyiIn reply to multiple consumer of an array by bagyi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |