function runTask(cancel, taskAndArguments) {

            function run(args) {
                return cancel.requested ? null : _.isFunction(task) ? task.apply(agent, args) : task;
            }

            function accept(result) {
                if (!cancel.requested) {
                    value = result;
                    agent.trigger("update", result, agent);
                }
            }

            function reject(err) {
                if (!cancel.requested) {  // ANNOYANCE: when cancelled, this task's error is silently suppressed
                    agent.trigger("reject", err, agent);
                }
            }

            function fail(err) {
                agent.trigger("fail", err, agent);
            }

            try {
                // When all arguments are resolved, invoke the task then either accept or reject the result.
                var task = taskAndArguments[0];
                when.all(_.rest(taskAndArguments)).then(run).then(accept, reject).done(undefined, fail);
                agent.trigger("submit", agent);
            } catch (err) {
                fail(err);
            }
        }
Invokes the specified task.
@param cancel the task's cancel function.
@param taskAndArguments the [task-function-or-value, arg0, arg1, ...] array.