I'm trying to follow the Droids lifecycle...

In the current implementation, it appears that a new Worker is created to run every Task

Strangely, the Worker seems to get its Task when the Queue is set:

 public void setQueue(Queue queue) {
    synchronized (this) {
      this.queue = queue;
      link = getQueue().next();
      if (link != null) {
        depth = link.getDepth();
      }
    }
  }

Is this really the best model to use?

(I know "anything is possible", but the example crawlers/walkers should share best practice code that can be extended and hopefully never revisited)

If a Worker is going to pull tasks off the Queue, should it do so in the run()? Also, I don't follow what happens when the Queue is empty.

ryan



Reply via email to