N
nolo contendere
Scenario:
I am expecting 3 files in a drop directory. They won't
necessarily all arrive at the same time. I want to begin processing
the each file as soon as it arrives (or as close to arrival time as is
reasonable). Would the best way to go about this be to simply have a
script that takes a filename as a parameter and marks the file as
'currently processing' when it begins to process the file (or could
move the file to a different directory)?
I could kick off 3 daemon processes looking in the drop directory, and
sleep every 5 secs, for instance.
That seems to me, to be a straightforward, if clumsy, approach. I was
wondering if there was a module that could accomplish this task more
elegantly--Parallel::ForkManager, at least in my experience, doesn't
seem entirely suited to this particular task.
Or I could code my own fork,exec,wait/waitpid.
I know TMTOWTDI, but I was seeking to benefit from others' experience,
and for a 'best practice'.
Sorry there's no tangible code; this is more of a conceptual question
I guess.
I am expecting 3 files in a drop directory. They won't
necessarily all arrive at the same time. I want to begin processing
the each file as soon as it arrives (or as close to arrival time as is
reasonable). Would the best way to go about this be to simply have a
script that takes a filename as a parameter and marks the file as
'currently processing' when it begins to process the file (or could
move the file to a different directory)?
I could kick off 3 daemon processes looking in the drop directory, and
sleep every 5 secs, for instance.
That seems to me, to be a straightforward, if clumsy, approach. I was
wondering if there was a module that could accomplish this task more
elegantly--Parallel::ForkManager, at least in my experience, doesn't
seem entirely suited to this particular task.
Or I could code my own fork,exec,wait/waitpid.
I know TMTOWTDI, but I was seeking to benefit from others' experience,
and for a 'best practice'.
Sorry there's no tangible code; this is more of a conceptual question
I guess.