public function attachCallback($callback, $type = self::TASK_COMPLETE)
    {
        if (!is_callable($callback)) {
            throw new Exception('Invalid callback specified');
        }

        if (!in_array(
            $type,
            array(self::TASK_COMPLETE, self::TASK_FAIL, self::TASK_STATUS)
        )) {
            throw new Exception('Invalid callback type specified');
        }

        $this->callback[$type][] = $callback;

        return $this;
    }