func (t *Task) Succeed() error {
	return t.guardResolution(func() error {
		return t.lifecycle.Complete(t)
	})
}
Succeed signals the lifecycle that work on this task has been completed,
and removes the task from the worker queue.
package worker
import (
	"encoding/hex"
	"errors"
	"sync"
)
var ErrAlreadyResolved = errors.New("Attempted to resolve an already-resolved task.")
type Task struct {
	lifecycle Lifecycle
	payload []byte
	resolved   bool
	resolvedMu sync.Mutex
}
func NewTask(lifecycle Lifecycle, payload []byte) *Task {
	return &Task{lifecycle: lifecycle, payload: payload}
}
func (t *Task) Bytes() []byte { return t.payload }
func (t *Task) SetBytes(bytes []byte) { t.payload = bytes }