Accepted answer

How did I get around this?

Conceptually unite GridTasks and GridJobs. MySpecialGridTask can only have one MySpecialGridJob.

Then, it is easy to execute new GridTasks in the Task or the Job.

In the example above:

class CrawlJob extends GridJob {

  var twitterId:String = new String()

  def cancel() = {
    println("cancel - " + twitterId)

  def execute():Object = {
    println("fetch friends for - " + twitterId)
    // Fetch and execute CrawlJobs for all friends
    // Execute Job Here
    grid.execute(classOf[CrawlTask], "twitter-user-2").get
    grid.execute(classOf[CrawlTask], "twitter-user-3").get
    return null


Related Query

More Query from same tag