L
List.rb
All, I've written a distribution service that spawns processes using
IO.popen in a seperate thread for each job.
In my Task class, I would like to create a block method such as
'Task.monitor(mode="stdout")', which would yield the stdout for that
task from that point forward. -- similar to tail -f, but for a
multithreaded environment.
The result would in essence be called like:
task = Task.newcmd => "tail -f /some/log")
sleep 10
task.monitor
# fresh content from some/log will be yielded
Since $stdout is global, what would be the beat way tackle this?
IO.popen in a seperate thread for each job.
In my Task class, I would like to create a block method such as
'Task.monitor(mode="stdout")', which would yield the stdout for that
task from that point forward. -- similar to tail -f, but for a
multithreaded environment.
The result would in essence be called like:
task = Task.newcmd => "tail -f /some/log")
sleep 10
task.monitor
# fresh content from some/log will be yielded
Since $stdout is global, what would be the beat way tackle this?