I would like to know what is best from the point of view of industry practice - to read in a file using a multi-threaded approach. In Java, I would do something like the following:
class Reader { Result readFile(File file, Listener callback) } class Listener { void process(Result r) }
Reader will spawn another thread to generate the result, and then call the Listener from the workflow. Would this be a good approach? How can this be translated into Scala, which probably has other, more efficient mechanisms for achieving this?
Bober02
source share