On Nov 17, 2:26 pm, David Pollak <[email protected]> wrote: > Neither Lift Actors nor Scala Actors are meant for blocking IO. So, reading > in an Actor is just going to be pain. You're a lot better off using a > thread for reading and a separate thread for writing.
My reading actor is simply slurping a Source, then it feeds the writer. > A writing thread should never ask for input... the input should always be > put in a queue and consumed by the thread doing the writing. Indeed, that was my original design. However I have millions of lines, and in the case of a writer which inserts into a database, the queue might get out of hand. > > I can create the Lift actors for reader and writer, and then they will > > start themselves to work forever. How would I recreate the above > > semantics to shut down on EOF? > > There's no such thing as "shut down" for Lift Actors. They are like any > other object in your JVM. They respond to messages and when there are no > more references to them, they get garbage collected. So here's the crux of the question. If I just create them in the main driver, the reader slurps all lines of the input and waits for gimme messages, the writer does them all and waits for exit. How can I declare them so they will be garbage collected? Cheers, Alexy -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/liftweb?hl=.
