in reply to Receiving data asynchronously in a long-run process
If you use a named pipe and file locking to synchronize its access, then the writer (or writers) will block until a reader is ready. In your case, if no workers are ready to read from the named pipe, then the job issuer will block.
It's important to consider that workers may need to poll, even if you'd prefer them not to. If no workers are ready, then the job issuer will need to save the job somewhere reliable. That's generally a database or spool directory. In that case, workers must poll for new jobs when the become ready again.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Receiving data asynchronously in a long-run process
by Annirak (Novice) on Sep 21, 2009 at 19:37 UTC |
In Section
Seekers of Perl Wisdom