I\'m trying to figure out how to continuously read a file and once there is a new line added, output the line. I\'m doing this using a sleep thread however it just seems to
If you're planning to implement this on a reasonable sized application where multiple objects might be interested in processing the new lines coming to the file, you might want to consider the Observer pattern.
The object reading from the file will notify each object subscribed to it as soon as a line has been processed. This will allow you to keep logic well separated on the class where it's needed.