assert task is a function, use a deferred throw on failure