merge two Tasked methods

In practice, the returned task is coupled to the conversion function,
so task and taskToNode were merged.  Also, renamed 'task' to 'act'.
This commit is contained in:
Mark Harrah 2010-08-14 09:50:22 -04:00
parent 44c49ab531
commit 23bf3e55c7
2 changed files with 3 additions and 4 deletions

View File

@ -86,8 +86,7 @@ trait Member[Node <: Member[Node]]
trait Tasked
{
type Task[T] <: AnyRef
def task(name: String, state: State): Option[Task[State]]
implicit def taskToNode: NodeView[Task]
def act(in: Input, state: State): Option[(Task[State], NodeView[Task])]
def help: Seq[Help]
}
trait TaskSetup

View File

@ -200,8 +200,8 @@ object Commands
case c: TaskSetup => (c.checkCycles, c.maxThreads)
case _ => (false, Runtime.getRuntime.availableProcessors)
}
for(task <- p.task(in.name, s)) yield
processResult(runTask(task, checkCycles, maxThreads)(p.taskToNode), s)
for( (task, taskToNode) <- p.act(in, s)) yield
processResult(runTask(task, checkCycles, maxThreads)(taskToNode), s)
}
}
}