I have to code one actor, ActorReader, that reads file and passes, line by line, the contents of this file to other actors, ActorProcessor 1, ActorProcessor 2, etc.
In Actors ref, section FlowControl i there is a sketch of how to optimize the flowcontrol. But can you give me some details of that?
Anyone could suggest how to implement that?
Thanks in advance Xan.
brianTue 17 Jan 2012
You just have to remember that if you producer is generating messages faster than your consumers can process it that you are buffering up messages in memory. That section in the docs has pretty concrete suggestions. You can also look at Fantom's wide finder implementation which was pretty seriously optimized to process multi-GB text files (although that code is fairly ancient).
Xan Tue 17 Jan 2012
Hi,
I have to code one actor, ActorReader, that reads file and passes, line by line, the contents of this file to other actors, ActorProcessor 1, ActorProcessor 2, etc.
In Actors ref, section FlowControl i there is a sketch of how to optimize the flowcontrol. But can you give me some details of that?
Anyone could suggest how to implement that?
Thanks in advance Xan.
brian Tue 17 Jan 2012
You just have to remember that if you producer is generating messages faster than your consumers can process it that you are buffering up messages in memory. That section in the docs has pretty concrete suggestions. You can also look at Fantom's wide finder implementation which was pretty seriously optimized to process multi-GB text files (although that code is fairly ancient).
Xan Tue 17 Jan 2012
I will read it... I will notice you, surely.