func TaskDeadlineDuration(v time.Duration) TaskOption {
	return func(t Task) TaskOption {
		previous := t.DeadlineDuration()
		t.SetDeadlineDuration(v)
		log.WithFields(log.Fields{
			"_module":                "core",
			"_block":                 "TaskDeadlineDuration",
			"task-id":                t.ID(),
			"task-name":              t.GetName(),
			"task deadline duration": t.DeadlineDuration(),
		}).Debug("Setting deadlineDuration on task")
		return TaskDeadlineDuration(previous)
	}
}
TaskDeadlineDuration sets the tasks deadline.
The deadline is the amount of time that can pass before a worker begins
processing the tasks collect job.
package core
import (
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"time"
	log "github.com/sirupsen/logrus"
	"github.com/intelsdi-x/snap/core/serror"
	"github.com/intelsdi-x/snap/pkg/schedule"
	"github.com/intelsdi-x/snap/scheduler/wmap"
)
type TaskState int
const (
	TaskDisabled TaskState = iota - 1
	TaskStopped
	TaskSpinning
	TaskFiring
	TaskEnded
	TaskStopping
)
var (
	TaskStateLookup = map[TaskState]string{
		TaskDisabled: "Disabled",  
		TaskStopped:  "Stopped",   
		TaskSpinning: "Running",   
		TaskFiring:   "Running",   
		TaskEnded:    "Ended",     
		TaskStopping: "Stopping",  
	}
)
type TaskWatcherCloser interface {
	Close() error
}
type TaskWatcherHandler interface {
	CatchCollection([]Metric)
	CatchTaskStarted()
	CatchTaskStopped()
	CatchTaskEnded()
	CatchTaskDisabled(string)
}
func (t TaskState) String() string {
	return TaskStateLookup[t]
}
type Task interface {
	ID() string
	State() TaskState
	HitCount() uint
	GetName() string
	SetName(string)
	SetID(string)
	MissedCount() uint
	FailedCount() uint
	LastFailureMessage() string
	LastRunTime() *time.Time
	CreationTime() *time.Time
	DeadlineDuration() time.Duration
	SetDeadlineDuration(time.Duration)
	SetTaskID(id string)
	SetStopOnFailure(int)
	MaxCollectDuration() time.Duration
	SetMaxCollectDuration(time.Duration)
	MaxMetricsBuffer() int64
	SetMaxMetricsBuffer(int64)
	GetStopOnFailure() int
	Option(...TaskOption) TaskOption
	WMap() *wmap.WorkflowMap
	Schedule() schedule.Schedule
}
type TaskOption func(Task) TaskOption